If you're using CentOS 8, you may have noticed that standard repositories are no longer accessible - updates and installations begin to fail with repository errors. This happens because CentOS 8 reached its End of Life (EOL) on December 31, 2021, and official mirrors have since been archived or removed.
In this guide, you'll learn how to restore repository access in CentOS 8 by replacing inactive URLs with vault or alternative archive mirrors, allowing you to continue using yum for package management.
If you encounter this error, we recommend switching to the current OS - OEL 8.
If for some reason you cannot switch OS, then to correct this error, it is enough to enter 2 commands:
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Done!
FAQ
- What is the CentOS Vault?
The Vault is an archive of old CentOS releases. It stores all packages and metadata but does not receive updates or security patches. - Is it safe to keep using CentOS 8 with Vault repos?
No. Vault repositories are static and no longer updated. This fix is a temporary workaround, and migrating to a supported OS is highly recommended. - Can I still receive security updates?
Not with CentOS 8. Consider switching to AlmaLinux, Rocky Linux, or Oracle Linux if you want a RHEL-compatible system with active support.