1、清除原来的yum源:
cd /etc/yum.repos.d
rm -rf ./*
2、下载阿里yum的reop源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3、清除原来的缓存,重新生成缓存:
yum clean all
yum makecache