Why does yum return error: [Errno 256] No more mirrors to try ?
Environment
- Red Hat Enterprise Linux 5 and later
- Red Hat Customer Portal
- Red Hat Subscription Management (RHSM)
- Red Hat Satellite
Issue
yum update
fails with the error : [Errno 256] No more mirrors to tryyum update
fails with :-
Error Downloading Packages:
InstallMedia: [Errno 256] No more mirrors to try.
- yum fails with :
Error Downloading Packages:
ftp-0.17-35.el5.x86_64:failure:ftp-0.17-35.el5.x86_64.rpm from Red5repo55:[Errno 256] No more mirrors to try. [[6]]" (code -1) Packages Scheduled
- yum fails with :
Downloading Packages:
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/supplementary/os/Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error Downloading Packages:
1:java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64: failure: Packages/java-1.6.0-ibm-1.6.0.15.0-1jpp.1.el6_4.x86_64.rpm from rhel-6-server-supplementary-rpms: [Errno 256] No more mirrors to try.
- On
Satellite Server
it fails with this error as per /var/log/messages
Jul 24 12:12:53 sat.example.com pulp: requests.packages.urllib3.connectionpool:INFO: Starting new HTTPS connection (1): cdn.redhat.com Jul 24 12:12:53 sat.example.com pulp: nectar.downloaders.threaded:INFO: Download failed:
Resolution
-
Check the network connectivity. If you are using IP addresses to configure firewall whitelist for access to the content delivery network (CDN), please ensure they're updated based on this list: Public CIDR Lists for Red Hat (IP Addresses for cdn.redhat.com)
-
Check what files are present under
/etc/yum.repos.d
directory by:-
# ll /etc/yum.repos.d
- If the system is registered to RHN Classic, only
rhel-source.repo
should be present under/etc/yum.repos.d/
.
If the system is registered with Red Hat Subscription Manager (RHSM) via subscription-manager,rhel-source.repo
and 'redhat.repo' are present.
If any local repositories, or any other media repositories are present, remove them by :-
# rm -rf /etc/yum.repos.d/<local or other repository name>
- Remove old yum cache from system by running following commands:
# rm -fr /var/cache/yum/*
# yum clean all
- Check if you can list the valid repositories by :-
# yum repolist
If you are using subscription-manager and the previous solutions do not work, try reenabling each repository one-by-one with the following:-
# REPOLIST=`subscription-manager repos --list-enabled | grep "Repo ID" | awk '{print $3}'`
# subscription-manager repos --disable="*"
# rm -fr /var/cache/yum/*
# yum clean all
# for i in ${REPOLIST}; do subscription-manager repos --enable=$i ; yum repolist; done
Root Cause
- Possible reasons for this issue:
- Corrupted yum cache.
- Inaccessibility of a repository URL from the system due to network related issues.
- Presence of customized or other media repositories.
- Outdated whitelist when using IP-based Firewall configuration to access Red Hat's Content Delivery Network (CDN).
Diagnostic Steps
- Check the accessibility of the repository URL in the system/network.
# ping URL
- Check the repositories under
/etc/yum.repos.d
ll /etc/yum.repos.d
- Collect a sosreport of the affected system.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
7 Comments
Hi Team,
Please note we have local repository configured.
[root@mpe3100 yum.repos.d]# cat /etc/yum.repos.d/hp.repo
[hp]
name=hp
baseurl=file:///arjun/rhel6
enabled=1
gpgcheck=0
[root@mpe3100 yum.repos.d]#
The cache has been cleared
root@mpe3100 yum.repos.d]# rm -fr /var/cache/yum/*
[root@mpe3100 yum.repos.d]#
Still we get the below error when we run yum install gcc
Total download size: 75 M
Installed size: 221 M
Is this ok [y/N]: y
Downloading Packages:
Error Downloading Packages:
ppl-0.10.2-11.el6.x86_64: failure: Packages/ppl-0.10.2-11.el6.x86_64.rpm from hp: [Errno 256] No more mirrors to try.
sinjdoc-0.5-9.1.el6.x86_64: failure: Packages/sinjdoc-0.5-9.1.el6.x86_64.rpm from hp: [Errno 256] No more mirrors to try.
mpfr-2.4.1-6.el6.x86_64: failure: Packages/mpfr-2.4.1-6.el6.x86_64.rpm from hp: [Errno 256] No more mirrors to try.
zlib-devel-1.2.3-29.el6.x86_64: failure: Packages/zlib-devel-1.2.3-29.el6.x86_64.rpm from hp: [Errno 256] No more mirrors to try.
Please confirm if we need to download and install the last four packages listed in error
check dns resolver /etc/resolv.conf
solved the issue, was clear and to the point.
If you are using satelitte6 and have Content Views with custom channel names or different from the one used of the container base image (by default 7Server) remember to add the --releasever=xyz modifier to all your yum commands
RUN yum clean all && yum --releasever=7.3 update && \ yum repolist --disablerepo=* && \ yum-config-manager --disable * > /dev/null && \ yum-config-manager --releasever=7.3 --enable rhel-7-server-rpms && \ yum install --releasever=7.3 -y bzip2 fontconfig
Consider also this solution to the problem I had below... (to [Errno 14] but also encountered [Errno 256] with HTTPS Error 404 - Not Found. The Errno 14 is perhaps most likely due to URL and "releasever" setting while Errno 256 related to GPG.
https://access.redhat.com/solutions/2850911 - As GPG armor is not enabled on server side, so ensure repo_gpgcheck is set to 0 in yum.conf file for RHEL clients.
Fresh install of RHEL 7.4 on VirtualBox 5.2 and have the same issue, though this did not resolve it. Followed these instructions up to "Install the latest updates" https://developers.redhat.com/products/rhel/hello-world/#fndtn-virtualbox_get-ready-for-software-development
Following issue on "yum update" or "yum repolist" as root (though system already registered and attached to RedHat Subscription Manager)
I am getting error in RHEL 7 GUI installation [Errno 256] No more mirrors to try Please explain how to remove this error and proceed with the installation
Check your dns settings. Check /etc/hosts/resolv.conf.