首先备份系统自带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源配置文件到该目录下(这里修改成了阿里镜像)

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


清理缓存

yum clean all


运行yum makecache生成缓存


 yum makecache


这时候再更新系统就会看到以下mirrors.163.com信息


 yum -y update