yum / dnf错误:无法下载用于回购的元数据 [英] yum/dnf error: Failed to download metadata for repo

查看:151
本文介绍了yum / dnf错误:无法下载用于回购的元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的CentOS 8服务器上,许多 dnf yum 命令失败,并显示以下错误:

On my CentOS 8 server, many dnf and yum commands fail with this error:


无法下载用于回购的元数据

Failed to download metadata for repo

这似乎适用仅用于涉及https连接的存储库,例如:

This seems to apply only to repositories involving https connections, e.g.:

/etc/yum.repos.d $ cat epel-modular.repo
[epel-modular]
name=Extra Packages for Enterprise Linux Modular $releasever - $basearch/pub/epel/$releasever/Modular/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-modular-$releasever&arch=$basearch&infra=$infra&content=$contentdir
...

我已经使用 wget 测试与这些站点的连接,并且成功,例如 wget https://mirrors.fedoraproject.org 成功。

I have used wget to test connectivity to these sites and it is successful, e.g. wget https://mirrors.fedoraproject.org succeeds.

但是,各种 dnf yum 命令失败:

However, various dnf or yum commands fail:

$ dnf provides /bin/ls
Extra Packages for Enterprise Linux Modular 8 - x86_64     0.0  B/s |   0  B     00:00
Failed to download metadata for repo 'epel-modular'
Error: Failed to download metadata for repo 'epel-modular'

# dnf update --refresh
CentOS-8 - AppStream                                        20 kB/s | 4.3 kB     00:00
CentOS-8 - Base                                             19 kB/s | 3.8 kB     00:00
CentOS-8 - Extras                                          7.4 kB/s | 1.5 kB     00:00
CentOS-8 - PowerTools                                       20 kB/s | 4.3 kB     00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64  4.1 kB/s | 3.5 kB     00:00
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 3.6 kB/s | 3.0 kB     00:00
Wazuh repository                                           0.0  B/s |   0  B     00:00
Failed to download metadata for repo 'wazuh_repo'
Error: Failed to download metadata for repo 'wazuh_repo'

如何解决此问题?

推荐答案

就我而言

sudo rm -r /var/cache/dnf 

解决了我的问题。

来源: https://access.redhat.com/discussions/4222851

这篇关于yum / dnf错误:无法下载用于回购的元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆