yum安装软件报错:Invalid configuration value: failovermethod=priority...

本文详细介绍了在CentOS系统中遇到的yum安装软件时出现'Invalid configuration value: failovermethod=priority'错误的三种情况及解决方法。包括编辑repo文件替换字符串、注释failovermethod=priority、以及因CentOS 8 EOL导致的源问题,提供了解决这些问题的具体步骤和建议。
摘要由CSDN通过智能技术生成

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

错误一:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-BaseOS.repo; Configuration: OptionBinding with id "failovermethod" does not exist
CentOS Linux 8 - AppStream                                                 6.3 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

当前环境为:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# uname -srm
Linux 4.18.0-348.2.1.el8_5.x86_64 x86_64

CentOS版本为:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 8.5.2111

解决办法:

1.找到CentOS相关目录,备份CentOS-AppStream,CentOS-Base文件,一般CentOS目录在/etc/yum.repos.d文件夹下,如下:

file

备份:

cp CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo1
cp CentOS-Linux-BaseOS.repo CentOS-Linux-BaseOS.repo1

2.编辑文件CentOS-Linux-AppStream.repo,CentOS-Linux-BaseOS.repo进行字符串替换:

vi CentOS-Linux-BaseOS.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

vi CentOS-Linux-AppStream.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

3.执行命令:

yum makecache
yum update

命令执行效果:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum update
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:01:22 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Error: 
 Problem: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-4.el8.noarch
  - package centos-stream-repos-8-4.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.5-1.2111.el8.noarch
  - problem with installed package centos-linux-repos-8-3.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

再次执行命令yum install expect,结果如下:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum install *expect*
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata exp
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值