How to Setup CentOS 7 Vault Repositories

CentOS 7 does not meet our System Requirements as it has reached EOL

After CentOS 7 reached EOL last month we have seen many CentOS 7 repositories be shutdown including the official repositories and datacentre repositories. This has left those still running CentOS 7 with yum (CentOS 7 Package Manager) non-functional. Though we suggest all customers using CentOS 7 migrate as soon as possible, this is not always possible. Having a functional package manager is important to aid in migration and to keep your server functional so we will be outlining some simple steps to move your CentOS 7 server to use the CentOS vault repositories.

Please note this is not a long term solution, the vault repositories are setup provide access to older archived versions, and do not include security updates into the trees on this server. These instructions are intended as a temporary option for customers.

1. Disable Centos-Base Repositories

The first step is to disable all Centos-base repositories on your server by setting the enabled variable to 0 as shown in the example below. The CentOS-Base repository file should be found at /etc/yum.repos.d/CentOS-Base.repo and can be edited with your preferred text editor such as vi or nano.

[base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates

[updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2. Enable Centos-Vault.repo Repositories

Add the following configuration to the end of Centos-Vault.repo file, again located /etc/yum.repos.d/CentOS-Vault.repo and edited with your preferred text editor.

# Vault

[Vault-base] name=Vault - CentOS-$releasever - Base baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever

[Vault-updates] name=Vault - CentOS-$releasever - Updates baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever

[Vault-extras] name=Vault - CentOS-$releaseverExtras baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever

3. Update the Yum Cache

Run the following to clear and update the yum cache:

yum clean all ; yum makecache

4. Verify Yum is Using the Vault Repositories

Run the followng command to list the used repositories:

yum repolist

Migrate to a Modern Operating System as Soon as Possible

CentOS 7 hit end-of-life on June 30th 2024 and is no longer be supported by CentOS, or the MediaCP. CentOS 7 is a very old operating system and has been falling behind in technology for several years. Now that we have hit EOL we are seeing more and more issues. It is important for your servers security and stability to migrate to a newer operating system as soon as possible.

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment