I’ve been wondering why every major release of CentOS breaks yum on older release. For example, after CentOS 6 is EOL, you cannot use yum on CentOS6; after CentOS 7 EOL, you cannot use yum to install a software on CentOS7. I don’t mean installing new software on old CentOS, but mean installing old software on old CentOS. I know RedHat is forcing people to upgrade to newer version of CentOS. This is annoying but tolerable and I have no choice but to believe its security excuse. But today, when I could not use yum on CentOS 7 then re-installed CentOS 8 on my vps, I was disappointed to find I still could not use yum on CentOS 8. Searching the problem on google I found CentOS 8 is also EOL. There is no CentOS9 option when re-installing OS in my VPS’s management dashboard. Till then, I began to be aware of Redhat’s trick, why it insists in forcing people to upgrade to new version by making old version not work. All its efforts aim to lure people to its paid RHEL. It is a very patient business man who takes long time to let people adhere to its ecosystem by providing free CentOS. By forcing people to upgrading continuously, it expects less resistance when finally forcing people to buy its paid OS who will feel less pain.
How does it make old version of CentOS not work? It removed the software in http://mirror.centos.org/centos-7/ and http://mirror.centos.org/centos-8 so yum on CenOS 7 and CentOS 8 could not find the software to install through the baseurl parameter in repo files. It decommissioned the sub-domain name mirrorlist.centos.org so yum on CenOS 7 and CentOS 8 could not find the software to install through the mirrorlist parameter in repo files. Now, yum will complain it cannot resolve the domain name mirrorlist.centos.org despite the fact your DNS settings are working well.
To use yum on CentOS 7/8 after their EOL, you should manually modify the repo file CentOS-Base.repo to change the mirrorlist parameter from http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra to https://vault.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra, and change the baseurl parameter from http://mirror.centos.org/centos/$releasever/os/$basearch/ to https://vault.centos.org/centos/$releasever/os/$basearch/
To avoid using outdated cached mirrors, you should issue “yum clean all” before installing a software.