Could not resolve host: mirrorlist.centos.org

执行 [root@localhost yum.repos.d]# yum install bind-utils时,报centos-release-scl-rh Could not resolve host: mirrorlist.centos.org; Unknown error

1. 先备份 CentOS-SCLo-scl-rh.repo和CentOS-SCLo-scl.repo

[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo      CentOS-CR.repo         CentOS-fasttrack.repo  CentOS-SCLo-scl.repo      CentOS-SCLo-scl-rh.repo      CentOS-Sources.repo  CentOS-x86_64-kernel.repo  epel-testing.repo
CentOS-Base.repo.bak  CentOS-Debuginfo.repo  CentOS-Media.repo      CentOS-SCLo-scl.repo.bak  CentOS-SCLo-scl-rh.repo.bak  CentOS-Vault.repo    epel.repo

[root@localhost yum.repos.d]# cp CentOS-SCLo-scl-rh.repo CentOS-SCLo-scl-rh.repo.bak
[root@localhost yum.repos.d]# cp CentOS-SCLo-scl.repo CentOS-SCLo-scl.repo.bak

2. 修改上面2文件中的内容,将mirrorlist=行注释,并将BaseUrl配置项中的mirror.centos.org修改为vault.centos.org

# CentOS-SCLo-rh.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information

[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/rh/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-rh
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-rh-testing]
name=CentOS-7 - SCLo rh Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/rh/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-rh-source]
name=CentOS-7 - SCLo rh Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/rh/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-rh-debuginfo]
name=CentOS-7 - SCLo rh Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information

[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/sclo/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

3. 再进行后续操作

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
posted @ 2025-09-25 15:16  codetodo  阅读(5)  评论(0)    收藏  举报