一、删除原来的yum源
PS:因为垃圾根本不做备份
[root@xiaohan-test yum.repos.d]# cd
[root@xiaohan-test ~]# cd /etc/yum.repos.d/
[root@xiaohan-test yum.repos.d]# ls
CentOS-Base.repo ctyun-CentOS7.4.repo
[root@xiaohan-test yum.repos.d]# rm -rf *
二、下载阿里yum源
[root@xiaohan-test yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
三、清除缓存并生成新的缓存
[root@xiaohan-test yum.repos.d]# yum clean all && yum makecache