1 进入目录 /etc/yum.repos.d/
2 备份原镜像文件
mv CentOS-Base.repo CentOS-Base.repo.bak
3 下载新的CentOS-Base.repo
执行如下任意一条命令即可:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4 清除原有yum缓存
yum clean all
5 生成缓存
yum makecache