美文网首页
Could not resolve host: mirrorli

Could not resolve host: mirrorli

作者: odison | 来源:发表于2024-07-19 16:47 被阅读0次

原因如下:

https://lists.centos.org/hyperkitty/list/discuss@lists.centos.org/thread/MHVDYBZEC2C434WR4O2VZ6G3AO2XKKHY/

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

  1. 填入以下内容(如果当前版本的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
  1. 更改base 的enable 为0

ex:

# 查看系统版本
cat /etc/redhat-release

相关文章

网友评论

      本文标题:Could not resolve host: mirrorli

      本文链接:https://www.haomeiwen.com/subject/qggdhjtx.html