Solving "[errno 256] No More Mirrors to Try" Error

“[Errno 256] No More Mirrors to Try” is a common error message while installing packages or running yum-install. It means that yum could not contact any of the configured mirrors and none of them had the requested package. This error can be fixed by increasing the maximum number of mirrors yum tries to contact and ensuring that yum can reach the configured mirrors. Here is how:

Increase the number of mirrors yum can contact

By default, yum will try to contact only three mirrors. To increase the total number of mirrors that yum can contact, you can modify the maxmirrors directive in the “yum.conf” file located in /etc/yum.conf.

vi /etc/yum.conf 

Locate the maxmirrors directive and change the default value 3 to the desired value. Save and exit.

Ensure yum can reach the configured mirrors

The next step is to ensure that the configured mirrors can be reached. This can be done by using the command yum repolist to view the configured mirrors in the yum repository.

yum repolist

This will display the configured repositories. It will also show the URLs of the mirrors if the settings are correct. If the URLs are not correct or are unreachable, make sure to configure the correct mirror URLs.

Frequently Asked Questions

What is the [Errno 256] No More Mirrors to Try error?

The “[Errno 256] No More Mirrors to Try” error occurs when yum cannot contact any of the configured mirrors and none of them have the requested package.

How do I fix this error?

This error can be fixed by increasing the maximum number of mirrors that yum contacts and ensuring that the configured mirrors are reachable.

What is the default value of the maxmirrors directive?

By default, Yum will try to contact only three mirrors.

Where is the yum.conf file located?

The “yum.conf” file is located in the /etc/ directory.

How can I view the configured mirrors in the yum repository?

This can be done by using the yum repolist command. It will show the configured repositories, along with the URLs of the mirrors.

Sources:

Sources for this article include:

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Lxadm.com.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.