centos7 替换yum源

以centos7为例 ,以 修改为阿里的yum源

1. 备份本地yum源

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

2.获取阿里yum源配置文件

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

3.更新cache

 yum makecache 

4.查看

 yum -y update 

5.最后你就可以链接国内镜像了,其实就是那个什么城XXX的 。。。

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

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

yum makecache

yum -y update 

猜你喜欢

转载自my.oschina.net/u/2353881/blog/1786433