How to migrate CentOS 8 to CentOS 8 Stream

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)

  1. As the content of the CentOS 8 repositories has been moved to 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
  2. Do the migration:
    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:

1)
Please do so as soon as possible, this probably won't work forever and you are already not receiving any updates at this point in time! I found such a pet-server-box in a customer environment yesterday, therefore this posting…