This knowledge base serves as an easy-to-follow guide for configuring repository URLs for CentOS 7 and CentOS 8. It uses repository lists from the CentOS vault mirror, ensuring that these repositories remain accessible even after the OS has reached its end of life. Ideal for system administrators, developers, and CentOS enthusiasts, this guide guarantees effortless access to repository URLs for BaseOS, AppStream, Extras, CentOSPlus, and more, ensuring your CentOS machines are properly configured.
How to Configure a Repo in CentOS?
Before modifying the repository files, ensure you have appropriate backup procedures in place:
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Editing Repository Files:
To modify the repository sources, open the respective repository configuration file (/etc/yum.repos.d/CentOS-Base.repo) using your preferred text editor:
sudo vi /etc/yum.repos.d/CentOS-Base.repo
Replace the content in the file with the configurations listed below based on your CentOS version.
CentOS 7
To configure the working repositories for CentOS 7, add the following to your /etc/yum.repos.d/CentOS-Base.repo file:
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[centosplus]
name=CentOS-$releasever - CentOSPlus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
CentOS 8
To configure the working repositories for CentOS 8, add the following to your /etc/yum.repos.d/CentOS-Base.repo file:
[baseos]
name=CentOS Linux $releasever - BaseOS
baseurl=https://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[appstream]
name=CentOS Linux $releasever - AppStream
baseurl=https://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS Linux $releasever - Extras
baseurl=https://vault.centos.org/$contentdir/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[centosplus]
name=CentOS Linux $releasever - Plus
baseurl=https://vault.centos.org/$contentdir/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
When configuring repo list URLs for CentOS, it’s essential to ensure that the URLs correspond correctly with the specific CentOS version installed on your system. As CentOS versions advance, older releases are archived, and their repositories may move to designated URLs for historical releases.
CentOS vault mirror is an invaluable resource for maintaining access to packages and updates even after an OS version has reached its end of life. This knowledge base provides reliable and tested URLs for configuring repositories for CentOS 7 and CentOS 8, ensuring that it can continue to use and maintain its systems seamlessly.
You can also easily configure the Repo URL list for CentOS Stream too. To find the working URLs, visit this link: https://www.veeble.org/kb/centos-stream-repo-list-working-urls/.
Also Read: