DNF update command fails when mirrorlist unreachable

Solution Verified - Updated -


  • Currently, servers are configured with baseurl and mirrorlist options which should allow guaranteed repo access via baseurl if host serving mirrorlist is unreachable.
  • While trying to use DNF commands, With both mirrorlist and baseurl defined in a repo file, if the mirrorlist cannot be found it does not fall back to baseurl.
  • These options(baseurl and mirrorlist) used to work on RHEL5, RHEL6 and RHEL7 without issues but they seem not working on RHEL8.
  • Example config file used to configure this repo on RHEL8 clients:

    #fake mirror list to replicate issue
  • Following error is showing while trying to use DNF commands (such as update, list,..):

    # dnf  -v --disablerepo=* --enablerepo=RHEL-8 list
    Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, 
    repoclosure, repodiff, repograph, repomanage, reposync, uploadprofile
    DNF version: 4.2.7
    cachedir: /var/cache/dnf
    repo: downloading from remote: RHEL-8
    error: Status code: 404 for (
    RHEL-8                               22 kB/s | 195  B     00:00    
    Cannot download '': Cannot prepare internal mirrorlist: Status code: 404 for
    Failed to download metadata for repo 'RHEL-8'
    Error: Failed to download metadata for repo 'RHEL-8'


  • Red Hat Enterprise Linux 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In