Update CentOS Repo Files After Mirrorlist Reaches End of Life

CentOS operating system logo

CentOS operating system logo

CentOS reached its end of life on June 30, 2024, which can lead to problems when downloading or installing packages from repositories. The CentOS mirror list feature, used by the yum package manager, typically helps by automatically selecting the nearest and fastest mirror. However, in certain cases, you may need to disable this feature. Some common reasons include:

  1. Mirror Issues: Specific mirrors might be slow, outdated, or unreliable, leading to problems with package installations and updates.

Since mirrorlist.centos.org is no longer available, you’ll need to update the repository files on your CentOS server. Follow the steps below to modify the repo file accordingly.

To fix the issue, you can update all .repo files in bulk by running the following commands as the root user or with sudo after connecting to your server, IVS, or Booster via SSH:

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 provided commands will execute the following actions:

Comment out the mirrorlist lines by prefixing them with #, disabling any lines that start with mirrorlist=http.

Replace all occurrences of mirror.centos.org with vault.centos.org in the .repo files.

Uncomment the baseurl lines in the .repo files by modifying lines that start with #baseurl=http.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *