修改yum源

安装 centos 之后,修改 yum 源到其它国内源

1. 备份原文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 

2. 下载要切换的 yum 源到本地并命名

 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

参考资料:

1. http://mirrors.aliyun.com/help/centos

原文地址:https://www.cnblogs.com/cinlap/p/7574009.html