Fixing CentOS 7 Repositories After End of Life

CentOS 7 reached End of Life in June 2024.
After that date the standard mirror network stopped serving packages.

If you run commands such as:

yum update
yum install <package>

you may see errors similar to:

Error getting repository data for base
Cannot find valid baseurl for repo

The fix is to point the system repositories to the CentOS Vault, which stores the archived packages for the final CentOS 7 release.


Important Note for Koozali SME Server

This issue commonly appears on Koozali SME Server 10 systems because they are built on CentOS 7.

SME Server provides its own repositories such as:

However, the underlying CentOS base repositories are still required for many packages.

Once CentOS 7 reached end‑of‑life the normal mirror system stopped working, so SME servers may fail when trying to install or update packages.

Switching the CentOS repositories to the Vault archive restores normal operation.

This does not upgrade the system, it simply allows the server to continue installing packages from the final CentOS 7 archive while waiting for future platforms such as SME Server 11.


Step 1 — Edit the Repository File

Edit the main repository file:

/etc/yum.repos.d/CentOS-Base.repo

You must:

  1. Comment out the mirrorlist= lines
  2. Enable the baseurl= lines
  3. Point them to the Vault archive

Correct Repository Configuration

Base Repository

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

Updates Repository

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

Extras Repository

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

Step 2 — Refresh Yum

After saving the file rebuild the yum cache:

yum clean all
yum makecache

You should now see packages downloading from:

vault.centos.org

Quick One‑Line Fix (Optional)

For administrators comfortable using the command line, the following commands can automatically modify the repository file.

sed -i 's/^mirrorlist=/#mirrorlist=/' /etc/yum.repos.d/CentOS-Base.repo
sed -i 's|^#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/|baseurl=http://vault.centos.org/7.9.2009/os/$basearch/|' /etc/yum.repos.d/CentOS-Base.repo

Then run:

yum clean all
yum makecache

Notes


Summary

If a CentOS 7 or SME Server 10 system cannot access package repositories:

  1. Edit CentOS-Base.repo
  2. Replace the mirror lists with Vault URLs
  3. Rebuild the yum cache

After this change, package management will function normally again using the final CentOS 7 archive.