1、删除原yum源
cd /etc/yum.repos.d
rm -rf /etc/yum.repos.d/*
2、下载阿里云Centos-7.repo
# wget\curl命令下载: wget [options] [url] \ curl [options] [url]
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
3、yum clean all 清理缓存,重新加载yum
4、yum makecache 重新生成缓存
5、 yum repolist 查看yum源信息