以下MSのBlogを参照に、トラブルシュートしていくことで解決できる可能性があります。
yum/dnf update に失敗する場合の原因と解決方法
筆者が遭遇したのは以下のような状況でした。
[root@LinuxServer~]# dnf install -y rhui-client
Red Hat Enterprise Linux 8 for x86_64 – BaseOS – Extended Update Support from RHUI (RPMs) 220 B/s | 215 B 00:00
Errors during downloading metadata for repository ‘rhel-8-for-x86_64-baseos-eus-rhui-rpms’:
– Status code: 400 for https://rhui-2.microsoft.com/pulp/repos/content/eus/rhel8/rhui/8.4/x86_64/baseos/os/repodata/repomd.xml (IP: 20.24.186.80)
– Status code: 400 for https://rhui-3.microsoft.com/pulp/repos/content/eus/rhel8/rhui/8.4/x86_64/baseos/os/repodata/repomd.xml (IP: 20.24.186.80)
– Status code: 400 for https://rhui-1.microsoft.com/pulp/repos/content/eus/rhel8/rhui/8.4/x86_64/baseos/os/repodata/repomd.xml (IP: 20.24.186.80)
Error: Failed to download metadata for repo ‘rhel-8-for-x86_64-baseos-eus-rhui-rpms’:
Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
上記エラーは、
原因は、冒頭Blog記載のとおり、「古い RHEL VM イメージを利用している為、 TLS/SSL クライアント証明書の期限が切れていたから」でした。その為、
sudo yum update -y –disablerepo=’‘ –enablerepo=’microsoft*’
とコマンドすることで解決できました。
ただ、Blogでは、クライアント証明書が原因の場合は、SSL関連のメッセージがでるように紹介されていましたが、私の環境では出力されませんでした。
yumやdnfコマンドが失敗する場合、Blog内容を順番に確認していくのがよいと思います。