CentOS 7.9 yum install 失败错误信息base|3.6kB 00:00:00 Could not retrieve mirrorlist http://mirrorlist.centos.org?archx86_64release7reposclo-rh error was14:curl#6 - Could not resolve host: mirrorlist.centos.org; Name or service not knownOne of the configured repositories failed(Unknown), and yum doesnt have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work fix this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablereporepoid ... 4. Disable the repository permanently, so yum wont use it by default. Yum willthenjust ignore the repositoryuntilyou permanentlyenableit again or use--enablerepofortemporary usage: yum-config-manager--disablerepoidor subscription-manager repos--disablerepoid5. Configure the failing repository to be skipped,ifit is unavailable. Note that yum will try to contact the repo. when it runsmostcommands, so will have to try and fail eachtime(and thus. yum will be much slower). If it is a very temporary problem though, this is often anicecompromise: yum-config-manager--save--setoptrepoid.skip_if_unavailabletrue Cannotfinda valid baseurlforrepo: centos-sclo-rh/x86_64处理方案# 1. 备份原有仓库配置文件mkdir-p/etc/yum.repos.d/backupmv/etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/# 2. 创建新的仓库配置文件vim/etc/yum.repos.d/CentOS-Vault.repo[base]nameCentOS-7 - Basebaseurlhttp://vault.centos.org/7.9.2009/os/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[updates]nameCentOS-7 - Updatesbaseurlhttp://vault.centos.org/7.9.2009/updates/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[extras]nameCentOS-7 - Extrasbaseurlhttp://vault.centos.org/7.9.2009/extras/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[centos-sclo-rh]nameCentOS-7 - SCLo RHbaseurlhttp://vault.centos.org/7.9.2009/sclo/x86_64/rh/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[centos-sclo-sclo]nameCentOS-7 - SCLo SCLobaseurlhttp://vault.centos.org/7.9.2009/sclo/x86_64/sclo/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7# 3. 清理缓存并更新yum clean all yum makecache
CentOS 7.9 yum install 失败
发布时间:2026/7/3 12:08:39
CentOS 7.9 yum install 失败错误信息base|3.6kB 00:00:00 Could not retrieve mirrorlist http://mirrorlist.centos.org?archx86_64release7reposclo-rh error was14:curl#6 - Could not resolve host: mirrorlist.centos.org; Name or service not knownOne of the configured repositories failed(Unknown), and yum doesnt have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work fix this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablereporepoid ... 4. Disable the repository permanently, so yum wont use it by default. Yum willthenjust ignore the repositoryuntilyou permanentlyenableit again or use--enablerepofortemporary usage: yum-config-manager--disablerepoidor subscription-manager repos--disablerepoid5. Configure the failing repository to be skipped,ifit is unavailable. Note that yum will try to contact the repo. when it runsmostcommands, so will have to try and fail eachtime(and thus. yum will be much slower). If it is a very temporary problem though, this is often anicecompromise: yum-config-manager--save--setoptrepoid.skip_if_unavailabletrue Cannotfinda valid baseurlforrepo: centos-sclo-rh/x86_64处理方案# 1. 备份原有仓库配置文件mkdir-p/etc/yum.repos.d/backupmv/etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/# 2. 创建新的仓库配置文件vim/etc/yum.repos.d/CentOS-Vault.repo[base]nameCentOS-7 - Basebaseurlhttp://vault.centos.org/7.9.2009/os/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[updates]nameCentOS-7 - Updatesbaseurlhttp://vault.centos.org/7.9.2009/updates/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[extras]nameCentOS-7 - Extrasbaseurlhttp://vault.centos.org/7.9.2009/extras/x86_64/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[centos-sclo-rh]nameCentOS-7 - SCLo RHbaseurlhttp://vault.centos.org/7.9.2009/sclo/x86_64/rh/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7[centos-sclo-sclo]nameCentOS-7 - SCLo SCLobaseurlhttp://vault.centos.org/7.9.2009/sclo/x86_64/sclo/gpgcheck1gpgkeyhttp://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7# 3. 清理缓存并更新yum clean all yum makecache