CentOS 8 Error: Failed to download metadata for repo ‘appstream’

When updating packages on CentOS 8 server, I got the following error

[root@instance-20220409-2340 ~]# dnf update
Failed loading plugin "osmsplugin": No module named 'librepo'
CentOS Linux 8 - AppStream                                                                                                                                                  51  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@instance-20220409-2340 ~]#

This is because CentOS 8 have reached its End of life.

To fix the dnf error, you can change the repository baseurl to vault.centos.org

Advertisement

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

You may need to convert CentOS 8 to one of the supported Linux distributions.

Convert CentOS 8 to CentOS 8 Stream

To convert CentOS 8 to CentOS 8 Stream, run

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync

Convert CentOS 8 to AlmaLinux 8

AlmaLinux is RHEL 8 based (same as CentOS 8) Linux operating system. They provide easy way to convert CentOS 8 server to AlmaLinux.

Convert CentOS 8 to Rocky Linux 8

Rocky Linux is an open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux.

Convert CentOS 8 to Oracle Linux 8

Oracle Linux 8 is free and open source, based on RHEL 8

https://docs.oracle.com/en/learn/switch_centos8_linux8/index.html

Convert CentOS 8 to RHEL 8

RedHat provides Convert2RHEL script to convert CentOS 8 to RHEL 8. RHEL is now FREE for production up to 16 servers.

https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/migration-process/convert2rhel-how-to-convert-from-centos-linux-to-red-hat-enterprise-linux

Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement