How to switch to a different repository for CentOS 8 EOL

 CentOS 8 reached its end of life at the end of 2021. When using yum repositories for installation, you may encounter the following error:

 

 

 

Solution:

1、Navigate to the "repos" directory of yum.

       cd /etc/yum.repos.d/ 

 

2、Modify the contents of all CentOS files.

       sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* 

      sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* 

 

3、Update the yum source to Alibaba Mirror.

       yum clean all && yum makecache 

      yum -y install wget 

       wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo 

      yum -y install epel-release 

        

 

After switching to the Alibaba Mirror, test if you can successfully use yum to download the desired tools. 

 

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

To change the network interface name in CentOS 7.x

一.modify GRUB 1.Edit the GRUB configuration file by running the command: `vi...

To modify the hostname on CentOS

Method One:   1.Open a terminal or SSH into the Linux system. 2.Log in to the system with...

An incorrect configuration in the /etc/fstab file on the Linux system is causing login issues

Encountering communication issues with the machine, I checked the system error messages through...

How to use the atop monitoring tool in Linux

Atop is a monitoring tool used to monitor resources and processes in Linux systems. It...

How to enable/disable ping on Linux system

To prevent others from discovering and potentially attacking your machine through network ping...