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
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
C
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.