Downgrade Centos 8 Stream to Centos 8

Categories: linux

I have a few CentOS machines that needs to be converted to RHEL and that can be done using the convert2rhel script. However I’m running CentOS 8 Stream, which can’t be converted to RHEL 8, so I have to do a dowgrade to CentOS 8 first.

  1. Remove the centos-stream package.

    dnf remove centos-stream-release

  2. I got the message “Problem: The operation would result in removing the following protected packages: setup” So I had to do this first before attempting step 1 again.

    mv /etc/yum/protected.d/setup.conf /etc/yum/protected.d/setup.conf.backup
    remember to move it back once centos-stream-release is removed

  3. Copy the repository files from a new CentOS 8 installation to /etc/yum.repos.d/.

  4. Run a distro-sync.

    dnf distro-sync --releasever 8

  5. Reboot and Welcome to CentOS8.

    cat /etc/centos-release; CentOS Linux release 8.5.2111

  6. Convert it to RHEL 8 as mentioned above.