美文网首页
centos8使用yum安装软件报错

centos8使用yum安装软件报错

作者: d4d5907268a9 | 来源:发表于2023-05-14 11:27 被阅读0次

问题1
问题:/etc/yum.repos.d/CentOS-Epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist

解决:

  1. 找到对应的repo文件:/etc/yum.repos.d/CentOS-Epel.repo

  2. 注释掉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

相关文章

网友评论

      本文标题:centos8使用yum安装软件报错

      本文链接:https://www.haomeiwen.com/subject/oskpsdtx.html