Linux

How to fix Could not retrieve mirrorlist http://mirrorlist.centos.org

After CentOS 7 reaches EOL, the standard repositories and mirrors may be removed or become outdated. The CentOS Vault repository serves as an archive for older CentOS versions, ensuring that you can still access packages and updates even after the main repositories are no longer available. By switching to the Vault repository, you ensure that your system can continue to receive package updates and access older software packages that may not be available through current mirrors

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-*