- 安装wget
-
yum install -y wget
-
- 备份之前的源
-
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
-
- 下载阿里源
-
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
-
- 清理缓存
-
yum clean all
-
- 生成缓存
-
yum makecache
-
- 更新最新源设置
-
yum update -y
-