美文网首页
Error: Failed to download metada

Error: Failed to download metada

作者: 简单点的笨演员 | 来源:发表于2022-10-11 11:21 被阅读0次

一、Error: Failed to download metadata for repo ‘AppStream‘

CentOS 8 使用yum安装时出现如下错误:

#  yum info wget
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
EPEL for redhat/centos 8 - x86_64                                   9.9 MB/s |  13 MB     00:01    
CentOS Linux 8 - AppStream                                           81  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

问题分析

阿里云解释:centos8官方源已下线,建议切换centos-vault源

解决方法

1.删除AppStream源

rm -f /etc/yum.repos.d/CentOS-AppStream.repo
rm -f /etc/yum.repos.d/CentOS-Linux-AppStream.repo

2.下载vault源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

3.清除yum缓存

yum clean all

4.生成新缓存

 yum makecache

二、Error: Failed to download metadata for repo 'baseos'

接下来却出现如下错误:

# yum info wget
Repository extras is listed more than once in the configuration
Repository epel is listed more than once in the configuration
CentOS-8.5.2111 - Base - mirrors.aliyun.com                         106 kB/s | 3.9 kB     00:00    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                        49 kB/s | 1.5 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                     42 kB/s | 4.3 kB     00:00    
EPEL for redhat/centos 8 - x86_64                                    68 kB/s | 4.7 kB     00:00    
CentOS Linux 8 - BaseOS                                              86  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: No URLs in mirrorlist

问题分析

估计原因和上面一样。

解决方法

1.迁移 CentOS 8 到 CentOS Stream 8

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos

2.同步一下

dnf distro-sync

参考

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站 (aliyun.com)
Error: Failed to download metadata for repo ‘AppStream‘_脱发队长的博客-CSDN博客
Fix: “Error: Failed to download metadata for repo ‘appstream'” (CentOS 8) (haydenjames.io)

相关文章

网友评论

      本文标题:Error: Failed to download metada

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