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

浙公网安备 33010602011771号