返回顶部

ceotos7/8 yum源更换为阿里云

1.安装wget

yum install -y wget

2.备份原镜像

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back

3.下载阿里云镜像

cd /etc/yum.repos.d
# centos 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# centos8
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

4.清理yum缓存

yum clean all

5.生成yum缓存

yum makecache

6.更新yum(注意:一般更新指定的包就可以)

yum update -y
posted @ 2022-12-05 15:39  十方央丶  阅读(65)  评论(0)    收藏  举报