原因
mirrorlist.centos.org yum源用不了
解决办法就是
# cd /etc/yum.repos.d/
# mv CentOS-Base.repo CentOS-Base.repo_bak
# vim CentOS-Base.repo
CentOS系统操作
# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/*.repo_bak
# curl -o /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/
# curl -o /etc/yum.repos.d/CentOS-Linux-AppStream.repo http://vault.centos.org/8.5.2111/AppStream/x86_64/os/
# curl -o /etc/yum.repos.d/CentOS-Linux-Extras.repo http://vault.centos.org/8.5.2111/extras/x86_64/os/
文本内容如下
大陆机器
[base]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos/RPM-GPG-KEY-CentOS-7
非大陆机器
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
刷新yum源
# yum clean all
# yum makecache
# yum update