首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
进入yum源配置文件所在的文件夹
cd /etc/yum.repos.d/
下载163的yum源配置文件到上面那个文件夹内
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
运行yum makecache生成缓存
yum clean all
yum makecache
这时候再更新系统就会看到以下mirrors.163.com信息
[root@localhost yum.repos.d]# yum -y update
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* epel: mirror.sjtu.edu.cn
* extras: mirrors.163.com
* updates: mirrors.ustc.edu.cn
No packages marked for update
阿里云同理
http://mirrors.aliyun.com/repo/Centos-7.repo