Centos7将本地源更换为网易源

百度搜索: 网易源  点击进入网易开源镜像站 

1. 备份当前 repo 文件

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

2. 下载对应 repo 文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3. 生成缓存

   yum clean all 

   yum makecache

原文地址:https://www.cnblogs.com/canflyfish/p/11385704.html