centos8报错:Errors during downloading metadata for repository ‘base‘

Posted eyes++

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos8报错:Errors during downloading metadata for repository ‘base‘相关的知识,希望对你有一定的参考价值。

完整报错:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Base.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Base.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Base.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Base.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Base.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
CentOS-8 - Base - mirrors.aliyun.com                      0.0  B/s |   0  B     00:47    
Errors during downloading metadata for repository 'base':
  - Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 120.39.197.216)
  - Curl error (7): Couldn't connect to server for http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Failed to connect to mirrors.aliyuncs.com port 80: 拒绝连接]
错误:为仓库 'base' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

在网上找了很多资料都没用,最后在镜像站找到了原因:

是因为我之前配置阿里云镜像指令错了,以前是这样的:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

因此解决方案为:

# 进入yum目录
cd /etc/yum.repos.d

# 删除目录下所有文件(注意完整复制,不要漏了那个点)
rm -rf ./*

# 安装正确的源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

# 生成缓存
yum makecache

如果有兴趣了解更多相关内容,欢迎来我的个人网站看看:瞳孔的个人空间

以上是关于centos8报错:Errors during downloading metadata for repository ‘base‘的主要内容,如果未能解决你的问题,请参考以下文章

解决方法centos8 Errors during downloading metadata for repository ‘rabbitmq-erlang‘

解决方法centos8 Errors during downloading metadata for repository ‘rabbitmq-erlang‘

打开Myeclipse时遇到了如下报错: ‘Building workspace’ has encountered a problem. Errors occurred during the buil

已解决Errors during downloading metadata for repository ‘appstream‘: - Status code: 404 for

已解决Errors during downloading metadata for repository ‘appstream‘: - Status code: 404 for

已解决Errors during downloading metadata for repository ‘appstream‘: - Status code: 404 for