阿里yum源参考链接如下:
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11DsXG0k
- 备份原yum配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
-
下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
- 运行 yum makecache 生成缓存
- 更新完成,如下图(vim /etc/yum.repos.d/CentOS-Base.repo):