问题

所有 dnf 命令都失败并显示以下错误:

# dnf repolist
Oracle Linux 8 BaseOS Latest (x86_64) 0.0 B/s | 0 B 00:00
Failed to download metadata for repo 'ol8_baseos_latest'
Error: Failed to download metadata for repo 'ol8_baseos_latest
dnf was not able to refresh the cache as it could not reach the yum server itself, Hence pointing to cache being expired.
# yum clean metadata
Cache was expired <<<<<<<<<<<<<<
0 files remove
on  it road.com

解决方案

此问题是由网络问题或者不正确的代理设置引起的。

  1. 将代理添加到文件 /etc/dnf/dnf.conf 。
http://[proxy-host].[domain].com:[port]
# vi /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
http://[proxy-host].[domain].com:[port]

请将完全限定的域名和代理使用的端口替换到上面的代理设置中。

无法下载 Repo 'repo_name' 的元数据
日期:2020-09-17 00:14:51 来源:oir作者:oir