CentOS 7 yum update HTTP Error 404: Not found

If you’re still running CentOS 7 on your systems, you may have recently encountered errors when trying to run `yum update`.

[root@dx53 ~]# yum update
 * EA4: 102.22.80.80
 * cpanel-addons-production-feed: 102.22.80.80
 * cpanel-plugins: 102.22.80.80
 * epel: fedora.dimensiondata.com
 * remi-php73: mirrors.ptisp.pt
 * remi-safe: mirrors.ptisp.pt
EA4                                                                                                                                                                                  | 2.9 kB  00:00:00     
cpanel-addons-production-feed                                                                                                                                                        | 2.9 kB  00:00:00     
cpanel-plugins                                                                                                                                                                       | 2.9 kB  00:00:00     
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

This error occurs because CentOS 7 reached its end-of-life (EOL) on June 30, 2024. As a result, the main CentOS mirrors no longer host packages for this version.

CentOS maintains an archive of older repositories at vault.centos.org. To fix the YUM update errors, we need to point our system to these archive repositories. You can do this using sed command. First take a backup of your current yum.repo.d folder.

cd /etc/
tar -cvf yum-backup.tar yum.repos.d

Do a search and replace with sed command

sed -i 's/mirror\.centos\.org/vault.centos.org/g' /etc/yum.repos.d/*

Clear the YUM cache and regenerate it:

yum clean all
yum makecache

Now “yum update” command should work.

yum update

Keep using CentOS 7 is insecure. You should upgrade to RHEL 8 based OS like AlmaLinux 8 or RockyLinux to keep your server secure.

Back to CentOS

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *