使用yum install -y yum-utils 报了如下错误
错误1: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
错误2:Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist
1的解决方法 ,根据提示找到该文件 /etc/yum.repos.d/CentOS-epel.repo;
注释掉含有 failovermethod=priority 这一行
保存后退出,第一个错误解决
2 的解决方法(找了好久才找到.也不知道为啥这样)
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 install -y yum-utils即可成功