Unable to update the system as 'yum update' fails with https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7

Issue

  • When trying to perform a yum update or yum repolist the following error occurs:

    https://cdn.redhat.com/content/eus/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    
  • I am not able to fix the yum issue. Whenever I execute any yum command I get the below :-

    https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    Anderer Spiegelserver wird versucht.
    To address this issue please refer to the below knowledge base article
    
    https://access.redhat.com/articles/1320623
    
    If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
    
    
    
     One of the configured repositories failed (Red Hat Enterprise Linux 7 Server (RPMs)),
     and yum doesn't have enough cached data to continue. At this point the only
     safe thing yum can do is fail. There are a few ways to work "fix" this:
    
         1. Contact the upstream for the repository and get them to fix the problem.
    
         2. Reconfigure the baseurl/etc. for the repository, to point to a working
            upstream. This is most often useful if you are using a newer
            distribution release than is supported by the repository (and the
            packages for the previous distribution release still work).
    
         3. Disable the repository, so yum won't use it by default. Yum will then
            just ignore the repository until you permanently enable it again or use
            --enablerepo for temporary usage:
    
                yum-config-manager --disable rhel-7-server-rpms
    
         4. Configure the failing repository to be skipped, if it is unavailable.
            Note that yum will try to contact the repo. when it runs most commands,
            so will have to try and fail each time (and thus. yum will be be much
            slower). If it is a very temporary problem though, this is often a nice
            compromise:
    
                yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true
    
    failure: repodata/repomd.xml from rhel-7-server-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    

Resolution

  • Execute following commands:

    Note: If the directory /etc/yum/vars does not exist create it (mkdir /etc/yum/vars)**

    # touch /etc/yum/vars/releasever 
    # echo "7Server" >> /etc/yum/vars/releasever
    
  • If redhat-release is missing, install it by downloading from the portal.

Root Cause

  • $releasever variable is not getting translated correctly due to the absence of redhat-release package.

    $releasever
    You can use this variable to reference the release version of Red Hat Enterprise Linux. Yum obtains the value of $releasever from the distroverpkg=value line in the /etc/yum.conf configuration file. If there is no such line in /etc/yum.conf, then yum infers the correct value by deriving the version number from the redhat-release-server package. The value of $releasever typically consists of the major release number and the variant of Red Hat Enterprise Linux, for example 6Client, or 6Server.
    
  • RHEL6 yum variables

  • RHEL7 yum variables

  • Verify /etc/yum.conf for distroverpkg

     distroverpkg  The package used by yum to determine the "version" of the distribution, this sets $releasever for use in config. files. This can be any installed package. Default is `system-release(releasever)', `redhat-
                  release'. Yum will now look at the version provided by the provide, and if that is non-empty then will use the full V(-R), otherwise it uses the version of the package.
                   You can see what provides this manually by using: "yum whatprovides 'system-release(releasever)' redhat-release" and you can see what $releasever is most easily by using: "yum version".
    

Diagnostic Steps

  • The following command will show the variables used by yum:

    # python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
    
  • Output of a server not translating the $releasever:

    # python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)
    Loaded plugins: fastestmirror, langpacks, product-id
    {'arch': 'ia32e',
     'basearch': 'x86_64',
     'releasever': '$releasever',
     'uuid': '77c40fc6-e173-445d-a592-5d79cc85ecbb'}
    
    # yum version
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    Warning: RPMDB altered outside of yum.
    Installed: 7Server/x86_64                                                                                                                                                                        1312:02392ecef824f86c6e0524d5075a8aa66a07afbb
    Group-Installed: yum                                                                                                                                                                               13:eacff346055ddbea318727a879288d9e00dc7404
    version
    
  • Following command can be used to verify the variables in the dump file you will see the problem clearly in the logs.

    # yum-debug-dump
    
    yum-debug-dump version 1
    %%%%SYSTEM INFO
      uname: 3.10.0-123.20.1.el7.x86_64, x86_64
      rpm ver: RPM version 4.11.1
      python ver: 2.7.5 (default, Feb 11 2014, 07:46:25) [GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]
    %%%%YUM INFO
      arch: ia32e
      basearch: x86_64
      releasever: $releasever
      yum ver: 3.4.3
      enabled plugins: product-id,fastestmirror,langpacks
      global excludes: 
    ...
    %%%%REPOS
    %rhel-7-server-eus-rpms - https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/
      excludes: 
    Error accessing repo rhel-7-server-eus-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-7-server-rpms - https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/os/
      excludes: 
    Error accessing repo rhel-7-server-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-7-server-rt-beta-rpms - https://cdn.redhat.com/content/beta/rhel/server/7/x86_64/rt/os/
      excludes: 
    Error accessing repo rhel-7-server-rt-beta-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-7-server-rt-rpms - https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/rt/os/
      excludes: 
    Error accessing repo rhel-7-server-rt-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-ha-for-rhel-7-server-eus-rpms - https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/highavailability/os/
      excludes: 
    Error accessing repo rhel-ha-for-rhel-7-server-eus-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-ha-for-rhel-7-server-rpms - https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/highavailability/os/
      excludes: 
    Error accessing repo rhel-ha-for-rhel-7-server-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-rs-for-rhel-7-server-eus-rpms - https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/resilientstorage/os/
      excludes: 
    Error accessing repo rhel-rs-for-rhel-7-server-eus-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    %rhel-rs-for-rhel-7-server-rpms - https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/resilientstorage/os/
      excludes: 
    Error accessing repo rhel-rs-for-rhel-7-server-rpms: failure: repodata/repomd.xml from rhel-7-server-eus-rpms: [Errno 256] No more mirrors to try.
    https://cdn.redhat.com/content/eus/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    
  • Check if redhat-release package exists

    # rpm -qa | grep -i redhat-release
    
  • Component
  • yum

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