Skip to main content

Updating CentOS Repo Files After Mirrorlist End of Life

What

CentOS reached the end of life on June 30, 2024. This will cause issues when attempting to download install packages from repositories. The CentOS mirror list feature allows yum, the package manager, to find and use the nearest and fastest mirror automatically. However, there can be circumstances where disabling this feature is necessary, such as:

Mirror Issues: Sometimes, specific mirrors can be slow, outdated, or unreliable, causing issues with package installations and updates.

When/Why

Since mirrorlist.centos.org no longer exists, you will need to update the repo files on your CentOS server. Follow the steps below to update the repo file accordingly.

How

To resolve the issue, you can mass update all .repo files with the following commands run as root or with sudo when SSH'd to your Server, IVS or Booster:

sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum clean all && yum -y update

Explanation: The commands provided will perform the following actions:

  1. Replace all instances of mirror.centos.org with vault.centos.org in the .repo files.
  2. Uncomment (sed -i s/^#.*baseurl=http/baseurl=http/g) the baseurl lines in the .repo files.
  3. Comment out (sed -i s/^mirrorlist=http/#mirrorlist=http/g) the mirrorlist lines in the .repo files.