Diagnosing and Fixing CentOS 8 Repository 404 Errors After End-of-Life
Learn how to identify and resolve CentOS 8 repository 404 errors by redirecting dnf to the CentOS Vault archive after the distribution reached end-of-life.
09 Aug 2025, 05:06 UTC

Recognizable Condition
When running dnf update or yum update on a CentOS 8 system, the command fails with one or more 404 Not Found messages for metadata files such as repomd.xml.
Cause/Diagnostic Table
| Observed Symptom | Likely Cause |
|---|---|
dnf repolist shows multiple 404 errors | Default mirrorlist points to decommissioned centos.org mirrors |
Error: Cannot retrieve repository metadata | Base URL in .repo file is invalid or commented out |
Could not resolve host: vault.centos.org | Network connectivity or DNS issue to the vault |
Ordered Checks
- Verify network reachability to
vault.centos.orgon port 443 (e.g.,curl -I https://vault.centos.org). Requires root or sudo for subsequent file edits. - Inspect a repository file, e.g.,
cat /etc/yum.repos.d/CentOS-Base.repo, to confirm the presence ofmirrorlistlines and commented#baseurl. - Run
dnf repolistand note the exact 404 URLs.
Fixes Tied to Findings
1. Disable mirrorlist
As root or with sudo, comment out all mirrorlist directives:
sudo sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/CentOS-*.repo
This stops dnf from querying dead mirrors.
2. Enable and point baseurl to the vault
Uncomment the #baseurl line and replace the mirror.centos.org host with vault.centos.org. Using a pipe delimiter avoids clashes with slashes:
sudo sed -i 's|^#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|' /etc/yum.repos.d/CentOS-*.repo
If your files use https://mirror.centos.org already, adjust accordingly.
3. Clean metadata cache and refresh
sudo dnf clean all sudo dnf repolist
Check that the output lists repositories without 404 lines.
Verification of the Fix
Run a metadata sync:
sudo dnf check-update
Expected result: either "Everything is up to date" or a list of packages available for update from the vault. No 404 errors should appear.
Practical check: dnf repolist -v shows Repo-id: BaseOS with Meta URL: https://vault.centos.org/....
Limitations
- The vault provides only the packages that were available at the time of EOL; no new security errata or feature updates are published.
- Any third‑party repositories (e.g., EPEL, Remi) that also relied on centos.org mirrors must be updated separately.
Escalation Criteria
- Confirm the server can reach
vault.centos.org(firewall, proxy, DNS). - Check for custom .repo files outside
/etc/yum.repos.d/that may still contain mirrorlist. - Consider migrating to a supported distribution (CentOS Stream, Rocky Linux, AlmaLinux) if active updates are required.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.