yum/dnf 错误:无法为 repo 下载元数据 [英] yum/dnf error: Failed to download metadata for repo

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

问题描述

在我的 CentOS 8 服务器上,许多 dnfyum 命令失败并出现以下错误:

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

未能为 repo 下载元数据

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.

但是,各种 dnfyum 命令都会失败:

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'

我该如何解决这个问题?

How do I resolve this problem?

推荐答案

就我而言

sudo rm -r /var/cache/dnf 

解决了我的问题.

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

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

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