详情请查看 阿里云官方网站: https://opsx.alibaba.com/mirro 帮助信息
修改步骤:
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 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -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
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、清除缓存
yum makecache
如果遇到
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 28006.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 20 M RSS (759 MB VSZ)
Started: Mon Feb 17 03:06:47 2020 - 00:13 ago
State : Traced/Stopped, pid: 28006
执行
rm -f /var/run/yum.pid
转载 https://my.oschina.net/u/2357619/blog/1925984
关注公众号:TalkNewClass 免费阅读pulsar 专栏文章,下载电子书籍以及进群讨论交流学习。
电子书籍都是作者从程序员到架构师阅读过的书籍.