当前位置:   article > 正文

Could not resolve host: mirrorlist.centos.org; Unknown error_访问不了 mirrorlist.centos.org

访问不了 mirrorlist.centos.org

Since the mirrorlist.centos.org domain cannot be resolved even with Google’s DNS, it suggests that the domain might be down or deprecated. In such cases, configuring YUM to use direct URLs to the CentOS vault repositories is the best approach.

Here are the steps to set up your YUM configuration to use the CentOS vault repositories directly:

  1. Create or Edit the Repository File:
    Open or create the repository configuration file /etc/yum.repos.d/CentOS-Vault.repo:

    sudo nano /etc/yum.repos.d/CentOS-Vault.repo
    
    • 1
  2. Add the Following Configuration:

    [base]
    name=CentOS-7 - Base
    baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    [updates]
    name=CentOS-7 - Updates
    baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    [extras]
    name=CentOS-7 - Extras
    baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
  3. Save and Exit the Editor:
    Save the changes and exit the editor (in nano, you can do this by pressing Ctrl+O, then Enter, and Ctrl+X).

  4. Clean YUM Metadata:
    Clean the YUM metadata to ensure it uses the new repository configuration:

    sudo yum clean all
    
    • 1
  5. Install EPEL Release:
    Try installing the EPEL release package again:

    sudo yum install epel-release
    
    • 1

By configuring YUM to use the vault repositories, you should be able to bypass the issue with the unreachable mirror list and continue installing and updating packages on your CentOS 7 system.

Successfully resolved the issue with CentOS 7 YUM package repositories by backing up and clearing the configuration files in /etc/yum.repos.d/, cleaning the YUM cache, and configuring YUM to use the CentOS vault repositories. This solution was necessary because official support for CentOS 7 YUM packages ended on July 1st, 2024.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/818987
推荐阅读
相关标签
  

闽ICP备14008679号