Skip to main content

Updating CentOS Repo Files After Mirrorlist End of Life

What

CentOS hasreached reachedthe end of linelife 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


Mirrorlist.Since mirrorlist.centos.org no longer exists anymore andexists, you will need to update the repo files.files Onon your server,CentOS CentOS,server. locateFollow the steps below to update the repo file and update with following below.accordingly.

How

From the .repo file:

# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.

To resolve the issue, you can mass update all .repo files with: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

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.