CentOS 8 went EOL at the end of December 2021. There was no automatic migration to CentOS Stream 8 (which will receive updates till end of May 2024). The following describes how to migrate an existing CentOS 8 installation to CentOS 8 Stream:1)
vault.centos.org a few days ago, any dnf package operation probably results in “Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist”. If so, swap to the Stream repos first: sudo dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
sudo dnf install centos-release-stream sudo dnf swap centos-{linux,stream}-repos sudo dnf distro-sync cat /etc/centos-release
That's it. On a typical minimal installation, this will replace round about 600 packages.
Additionally, it might make sense to replace third party repositories with a module (→ dnf module list, dnf module info <modulename>). The following example replaces remi-php74 with Stream's php:7.4 module:
dnf list installed | grep @remi-php74
Remove these packages bit by bit with sudo dnf remove.
.repo file below /etc/yum.repos.d/): yum-config-manager --disable remi-php74
sudo dnf module install php:7.4 dnf module list --installed
dnf module info php:7.4
Now reinstall the packages you need.