Yum update 之后CentOS 8 failovermethod和appstream报错
LINUX版本:
原因:执行完yum update
系统更新到Centos 8 ,出现如下错误
- AppStream错误
Errors during downloading metadata for repository 'appstream': - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org] Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
- failovermethod错误
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist Repository epel is listed more than once in the configuration
解决方案:
- failovermethod处理
需要在/etc/yum.repos.d/CentOS-Epel.repo
删掉failovermethod
选项
failovermethod=priority
- 执行:
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
处理完再去执行我们自己的命令yum -y install systat
最后就正常了
本作品采用《CC 协议》,转载必须注明作者和本文链接