Why does yum return error: [Errno 256] No more mirrors to try ?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux
  • 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 try

Resolution

  • Check the network connectivity. If IP based Firewall is being used then whitelist the IPs that are mentioned in Public CIDR Lists for Red Hat (IP Addresses for cdn.redhat.com) for access to the content delivery network (CDN).

  • Check what files are present under /etc/yum.repos.d directory by:-

    # ll /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 the old yum cache from the system by running the following commands:

    # rm -fr /var/cache/yum/*
    # yum clean all
    
  • Check if the valid repositories are getting listed by:-

    # yum repolist
    
  • If the previous solutions does 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

  • yum update fails with any of the below errors:-

    Error Downloading Packages:
    InstallMedia: [Errno 256] No more mirrors to try.
    
    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
    
    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 an error: 404 Not Found"
    Trying other mirrors.
    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:
    
  • 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
    

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.

Comments