CentOS 7 - update repository URL after end of life (EOL) 2024-07-01
CentOS 7 will not get any updates after June 2024. Moreover mirrorlist.centos.org is not available anymore and all sources have been removed from mirror servers to reflect its end of life (EOL) status. In case you want to update your system to the latest version (CentOS 7.9.2009) or install a few packages you need to create a new CentOS.repo configuration with updated urls.
Removing old repositories
List all currently configured repositories and move CentOS and epel configurations afterwards:
[root@server ~]# ls /etc/yum.repos.d/ CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo CentOS-x86_64-kernel.repo epel.repo epel-testing.repo [root@server ~]# mkdir /etc/yum.repos.d/old [root@server ~]# mv /etc/yum.repos.d/CentOS*.repo /etc/yum.repos.d/old/ [root@server ~]# mv /etc/yum.repos.d/epel*.repo /etc/yum.repos.d/old/
Create a CentOS repository configuration with updated urls
Old CentOS versions are archived at https://vault.centos.org/ - we are going to create a new repository configuration using this server. Additionally we set metadata_expire to never because the sources won't change anymore (end of life).
[root@server ~]# cat /etc/yum.repos.d/CentOS.repo [base] name=CentOS-7.9.2009 - Base baseurl=http://vault.centos.org/7.9.2009/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=1 metadata_expire=never #released updates [updates] name=CentOS-7.9.2009 - Updates baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=1 metadata_expire=never # additional packages that may be useful [extras] name=CentOS-7.9.2009 - Extras baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=1 metadata_expire=never # additional packages that extend functionality of existing packages [centosplus] name=CentOS-7.9.2009 - CentOSPlus baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=0 metadata_expire=never #fasttrack - packages by Centos Users [fasttrack] name=CentOS-7.9.2009 - Contrib baseurl=http://vault.centos.org/7.9.2009/fasttrack/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 enabled=0 metadata_expire=never
Add EPEL repository configuration
This step is optional and only needed if EPEL has been used before:
[root@server ~]# cat /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=https://archives.fedoraproject.org/pub/archive/epel/7/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 metadata_expire=never [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=https://archives.fedoraproject.org/pub/archive/epel/7/$basearch/debug enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 metadata_expire=never [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=https://archives.fedoraproject.org/pub/archive/epel/7/SRPMS enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 metadata_expire=never
Load new packet sources
Remove all currently available metadata: yum clean all
Now enter yum check-update to load a new list of all available packages and to check if your local installation has all available updates. Afterwards you can install packages as usual using yum install.