Linux SysAdmin & DevOps

CentOS 8 Stream - Migrate from CentOS 8

CentOS 8 Stream - You have probably heard the news that CentOS era is gone. CentOS 8 will continue though as a CentOS Stream version you should upgrade to before the end of 2021.

I did that, out of curiousity, the upgrade went just fine but there are some things you should consider before migrating, at least at this point. I’m using wireguard for some VPN tunnels and after the upgrade, the wireguard module did not compile. So no more tunnels. I also use Bestcrypt to have an encrypted disk where I keep some private information. I didn’t succeed in compiling the bestcrypt modules. Other than that, everything seemed to work just fine. Of course, there might be other software imcompatibility issues that I am not aware of at this moment.

Getting back to CentOS 8 is not such a straight forward process though. Luckily my server is running as a KVM virtual machine and I had console access so I was able to fix it my server.

After reversing the process I was not able to login as a regular user on my server and not even via SSH using my public ssh keys. Booting in single user mode and mouting my linux partition and then using chroot, I was able to disocer that some files have been changed and/or missing:

/etc/pam.d/password-auth
/etc/pam.d/system-auth
/etc/pam.d/service-auth
/etc/pam.d/postlogin

So before upgrading you have to prepare your server (in case you want to revert the changes at some point):

Before upgrading, if you want to go to this path, you should prepare for the worst and take some safety steps:

mkdir /before-upgrade
cd /before-upgrade
yumdownloader centos-linux-release-8.3-1.2011.el8.noarch.rpm
yumdownloader centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm
cp -r /etc/ /before-upgrade/etc.backup

Then you can upgrade:

sudo dnf -y install centos-release-stream
dnf distro-sync -y

After a reboot, you should have successfully completed the migration and running the Stream version.

Now if you want to revert the changes:

rpm -e centos-release-stream --nodeps
cd /before-upgrade
rpm -Uhv centos-linux-release-8.3-1.2011.el8.noarch.rpm
dnf distro-sync -y

When the distro-sync process is completed, do not reboot. Instead, restore the /etc folder as it was initially:

/bin/cp -r /before-upgrade/etc.backup/* /etc/*

Now you can reboot!