原因如下:
This is because CentOS 7 has reached the end of its life. You need to modify your configuration to use https://vault.centos.org/ instead of the main mirrors.
解决方案:
Edit /etc/yum.repos.d/CentOS-Vault.repo, jump down to the end of the
file, where you see c7.9.2009, and enable the sections base, updates,
and extras for that version. Insert enabled=1. (This matches the default
enables for the original distro.) c7.9.2009 is the last release available.
Edit /etc/yum.repos.d/CentOS-Base.repo and add enabled=0 to all
sections. (Some optional sections already have this.)
详细步骤:
#
vi /etc/yum.repos.d/CentOS-Vault.repo
- 填入以下内容(如果当前版本的url不存在)
# C7.9.2009
[C7.9.2009/-base]
name=CentOS-7.9.2009/ - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.9.2009-updates]
name=CentOS-7.9.2009 - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.9.2009-extras]
name=CentOS-7.9.2009 - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.9.2009-centosplus]
name=CentOS-7.9.2009 - CentOSPlus
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.9.2009-fasttrack]
name=CentOS-7.9.2009 - Fasttrack
baseurl=http://vault.centos.org/7.9.2009/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
- 更改base 的enable 为0
ex:
# 查看系统版本
cat /etc/redhat-release
网友评论