在CentOS7中配置使用阿里云的yum源

当前系统版本为centos7

1、备份原来的yum源

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/

1
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

1
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、添加阿里云公共DNS

为了防止不能寻找yun源地址,生成cache,先添加阿里云的DNS

1
vim /etc/resolv.conf

添加

1
2
nameserver 223.5.5.5
nameserver 223.6.6.6

4、清理缓存

1
yum clean all

5、生成新的缓存

1
yum makecache

本文标题:在CentOS7中配置使用阿里云的yum源

文章作者:Francis

原始链接:http://www.cnops.com/posts/5bd5694.html

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。