Linux Commands - Resolve "failure: repodata/repomd.xml [Errno 256] No more mirrors to try."

by
Jeremy Canfield |
Updated: May 15 2024
| Linux Commands articles
Let's say something like this is being returned when issuing the repoquery --all command.
~]# repoquery --all
failure: repodata/repomd.xml from rhel-7-server-optional-rpms: [Errno 256] No more mirrors to try.
https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/8.9/x86_64/optional/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
When I ran into this issue it was because baseurl in my .repo file in the /etc/yum.repos.d directory was pointing to a directory that indeed did not exist.
baseurl = https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/8.9/$basearch/rhscl/1/os
I had to replace 8.9 with $releasever to resolve the issue.
baseurl = https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/$releasever/$basearch/rhscl/1/os
If issues persist, and you are on a Red Hat distribution, you can list the available releases.
~]# subscription-manager release --list
+-------------------------------------------+
Available Releases
+-------------------------------------------+
7Server
8.9
And then set the system to use a specific release.
~]# subscription-manager release --set=7Server
Release set to: 7Server
And validate it has been set.
~]# subscription-manager release --show
Release: 7Server
I also had to clear my yum (or dnf) cache.
yum clean all
And validate that the enabled repositories now have the specified release (7Server in this example).
~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID: rhel-7-server-optional-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Optional (RPMs)
Repo URL: https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/7Server/$basearch/optional/os
Enabled: 1
Repo ID: rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL: https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/7Server/$basearch/os
Enabled: 1
Repo ID: rhel-7-server-extras-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Extras (RPMs)
Repo URL: https://satellite.example.com/pulp/content/rhel7/content/dist/rhel/server/7/7Server/$basearch/extras/os
Enabled: 1
Did you find this article helpful?
If so, consider buying me a coffee over at