不知何时起CentOS的mirrorlist里去掉了5的yum源(放弃支持了),导致无法正常使用,需要手动修改
将/etc/yum.repos.d/CentOS-Base.repo中的片段改为这样(有好几处):
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://vault.centos.org/5.11/os/$basearch/ #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
也可以直接下载我的repo文件:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo https://img.geekzu.cn/2017/10/CentOS-Base.repo --no-check-certificate
然后更新一下
yum makecache yum update