RHEL8
Fedora
yum
dnf
docker-ce

RHEL8/Fedora - yum/dnf causes cannot download repodata/repomd.xml for docker-ce

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

The cannot download repodata/repomd.xml error usually means dnf or yum is pointing at a Docker repository URL that does not match your distribution, release, or current network trust settings. On RHEL and Fedora, the fix is usually to verify the configured Docker CE repository, clear stale metadata, and confirm that your distro version is actually supported by the repository path you are using.

Check the Docker CE Repository URL First

The fastest diagnostic step is to inspect the repo file:

bash
sudo cat /etc/yum.repos.d/docker-ce.repo

For Fedora, Docker's official repository is typically the Fedora path:

bash
sudo dnf config-manager addrepo --from-repofile https://download.docker.com/linux/fedora/docker-ce.repo

For RHEL, the official repository path is the RHEL one:

bash
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

If the file points to the wrong distro family or an outdated copied URL, repomd.xml downloads will fail even though the machine has network connectivity.

Clean Metadata and Retry

If the repository URL is correct, clear cached metadata before testing again:

bash
sudo dnf clean all
sudo rm -rf /var/cache/dnf
sudo dnf makecache

This forces dnf to fetch fresh metadata instead of retrying broken cached state.

It is a simple step, but it often separates a stale-cache problem from a real repository problem.

Verify Release and Support Mismatch

This error is common when the machine is on a Fedora release that Docker has not yet published packages for, or when a RHEL system is using a repo definition copied from another distribution.

Check the effective release:

bash
cat /etc/os-release

If the repo path expects a supported release but your system is newer or mismatched, dnf may request metadata that simply is not there yet.

In that case, the real fix is not another dnf clean. The real fix is to use the correct official repo for that distribution or wait until packages for that release are published.

Watch for TLS, Proxy, and Corporate Network Issues

If the repo URL is correct but downloads still fail, test the endpoint directly:

bash
curl -I https://download.docker.com/linux/fedora/

On enterprise networks, SSL interception, custom proxies, or restrictive firewalls can block metadata retrieval even when the repo file itself is valid. That is especially common on RHEL systems in managed environments.

Recreate the Repo Cleanly

If the repository file has been edited repeatedly, it is often easier to remove it and re-add it from the official source:

bash
sudo rm -f /etc/yum.repos.d/docker-ce.repo
sudo dnf config-manager addrepo --from-repofile https://download.docker.com/linux/fedora/docker-ce.repo

Use the Fedora URL on Fedora and the RHEL URL on RHEL. Mixing them is one of the simplest ways to trigger the missing repomd.xml error.

Common Pitfalls

  • Using a Fedora repo file on RHEL, or a RHEL repo file on Fedora, is a very common cause of the error.
  • A repo URL can be syntactically valid and still fail because the distribution release is not supported yet.
  • Cached metadata can preserve a bad state until you explicitly clean it.
  • Network proxies, TLS inspection, or firewall rules can make the error look like a repo misconfiguration when it is really a connectivity problem.

Summary

  • Start by confirming the Docker CE repo URL matches your actual distribution.
  • Clean dnf metadata and rebuild the cache before retesting.
  • Verify that your Fedora or RHEL release is supported by the repository path you configured.
  • If the repo file is suspect, recreate it from the official Docker repository definition for that distro.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.