centos8使用yum安装软件报错
2023-05-14 本文已影响0人
d4d5907268a9
问题1
问题:/etc/yum.repos.d/CentOS-Epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
解决:
-
找到对应的repo文件:/etc/yum.repos.d/CentOS-Epel.repo
-
注释掉failovermethod=priority这一行,即编辑该repo文件,在对应行添加 "#" 注释
问题2
问题:"Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist"
解决:
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
yum update -y
如果上述完成之后,仍报错 :
Error: Cannot find a valid baseurl for repo: appstream
继续如下操作:
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
做完上述4部之后,再测试一下
yum update -y