1.删除本地yum源,也可移动备份
# rm -rf /etc/yum.repos.d/*
2.下载阿里yum的基础源和扩展源
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
下图表示yum源安装成功
3.更新yum
# yum makecache