备份
cd /etc/yum.repos.d/
mkdir repo_bak
mv *.repo repo_bak/
安装wget(若已安装了wget,则跳过此步
wget -V
yum install wget -y
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
wget http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all 清除缓存,运行 yum makecache 生成新的缓存
yum clean all
yum makecache
安装EPEL(Extra Packages for Enterprise Linux )源
yum install -y epel-release
再次运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存
查看启用的yum源和所有的yum源
yum repolist enabled
yum repolist all
更新yum
yum -y update
https://www.cnblogs.com/qgc1995/archive/2018/08/29/9553572.html