修改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

posted @ 2017-09-22 11:33  试试手气  阅读(362)  评论(0编辑  收藏  举报