問題
すべての 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
解決策
この問題は、ネットワークの問題または不適切なプロキシ設定が原因で発生します。
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]
完全修飾ドメイン名と、プロキシが使用しているポートを上記のプロキシ設定に置き換えてください。