Is Errno 256 ‘No more mirrors to try’ preventing you from downloading packages?
Yum allows user to install packages and dependencies in a single command. However, not rarely, user experiences errors during updates. Usually the reason for such an error lies either on currupted yum cache or repo directory, which means that it can be fixed by a few file cleanups.
Fixing errno 256 is a usual part of our job in our server management services and is relatively simple. Let’s have a detailed look on yum errno 256 and how this could be fixed.
Fixing ‘Errno 256’
The failure error looks like this:
OR
Let’s see how we can fix it step by step.
1. Cleaning yum cache
Old cache is a typical reason behind errors while downloading packages. Therefore, deleting the cache using the command shown below would resolve such an issue.
rm -fr /var/cache/yum/*
Moreover, metadata for the enabled repositories should be deleted as well.
yum clean all
You may now try installing a package or updating your system. If the issue persists proceed to the next step.
2. Repository check
Yum repositorities can contain corrupted files in some servers, therefore accessing them while downloading packages can lead to errors. To resolve the issue, the folder yum.repos.d needs to be examined.
First of all, using the command 11 /etc/yum.repos.d
ll /etc/yum.repos.d/
We list the available repositorities and then we need to disable (except any file starting with CentOS as a name) every single one of them and try updating/installing the package you wanted.
3. Network access
Last but not least, network access is exigent for yum updates, therefore we should check the access to the repository URL by ping. Generally yum downloads the packages using the base URL contained in the repositority configuration file.
You may find the repositority URL by viewing /etc/yum.repos.d/ files for repos that are enabled. An example repositority URL for the epel.repo file is
download.fedoraproject.org
If you are looking for more information, this issue is further explained on RedHat’s website.