您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
更新yum源头为阿里云yum源
发布时间:2017-10-15 14:09:41编辑:雪饮阅读()
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存
可能会遭遇错误“Not using downloaded repomd.xml because it is older than what we have”
解决:
yum clean all && yum check-update
清除centos缓存文件就可以了
然后重新尝试生成缓存
关键字词:yum,源,阿里云