{CentOS,AlmaLinux,RockyLinux}8+ Unable to Update Print

  • 103

If you, for one reason or the other, are still actively using CentOS 8, you might probably have encountered the following error when trying to update your system or simply install a package.

yum -y update
Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

What is the Cause of This Error?

You may well be aware that CentOS Linux 8 died a premature death, it reached the End Of Life (EOL) on December 31st, 2021, thus it no longer receives development resources from the official CentOS project.

This means that after Dec 31st, 2021, to update your CentOS installation, you are required to change the mirrors to CentOS Vault Mirror, where they will be archived permanently.

To fix the above error, open your terminal or login via ssh, and run the following commands to change the repo URL to point to vault.centos.org, from the official CentOS repos.

Here we use the sed command to edit the required directives or parameters in the repo configuration files by pointing to the Cloudflare-based vault repository:

sed -Ei 's~mirrorlist~#&~;s~#(baseurl=http://)mirror.centos.org~\1vault.epel.cloud~' /etc/yum.repos.d/CentOS-*

Now you should be able to update CentOS or install packages without any error.

Our SiteHUB VPS' should come with this solution already implented on affected images, however, in the event that our kick-start script fails to run during an OS reinstall, please follow the steps above to implement.

 


Was this answer helpful?

Back