Centos 8 -> Centos Stream -> Rocky Linux

Hello,

After unexpected information about discontinuation of the Centos 8 development, I switched to the Centos Stream. I did not know about the Rocky Linux then.

Will it be possible to switch to the Rocky Linux from the Centos Stream?
or
Do I still have the option to switch back from Centos Stream to Centos 8?

Thank you in advance for your help.

1 Like

Hi, I have the same question. Thanks

Interested in this as well.

I am also interested in this.

DISCLAIMER I BY NO MEANS TAKE RESPONSIBILITY FOR YOUR SYSTEM. The instructions below are what worked for ME. I hope it is helpful to someone else.

I decided tonight to downgrade from CentOS 8 Stream → CentOS 8 Linux in preparation for transitioning over to Rocky. Below is how i did it and the problem(s) i ran into.

Inspiration:

Steps

  • Download repo and release RPMs
wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.3-1.2011.el8.noarch.rpm
wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm
  • Remove stream repo and release RPMs and install the plain CentOS ones
sudo rpm -e --nodeps centos-stream-release centos-stream-repos
sudo rpm -ivh centos-linux-release-8.3-1.2011.el8.noarch.rpm centos-linux-repos-8-2.el8.noarch.rpm
  • Distrosync (i had to run with --allowerasing in order for it to run)
sudo yum distro-sync --allowerasing
  • Reboot
sudo reboot
  • When my system rebooted, i could no longer login. To fix this, i had to follow the Red Hat recovery procedure to boot into recovery mode and fix authselect that was broken for some reason: Chapter 15. Changing and resetting the root password Red Hat Enterprise Linux 8 | Red Hat Customer Portal

  • At GRUB 2 menu, edit the CentOS Linux 8 boot kernel (there will be some CentOS 8 Stream lines, ignore those)

  • In the GRUB 2 menu, go the line that starts with linux at the end add rd.break

  • When the system boots up, your root filesystem will be placed into /sysroot, we need to remount that from read-only to read-write

mount -o remount,rw /sysroot
  • Enter a chroot environment at /sysroot this will allow our CLI utilities to work properly
chroot /sysroot
  • Notice that passwd doesn’t work and /etc/nsswitch.conf is a broken symlink
$ passwd
Permission Denied
$ cat /etc/nsswitch.conf
File doesn't exist   # i'm paraphrasing here because i forget the exact error
  • Fix /etc/nsswitch.conf using authselect
# minimal sets up for reading from /etc/passwd and /etc/shadow only, no sssd daemon
authselect select minimal
  • Tell SELinux to relabel
touch /.autorelabel
  • Exit the chroot
exit
  • Exit (yes, exit) the recovery and this will continue the boot and relabel the filesystem properly
exit
  • System will reboot
  • If you were like me and have proprietary NVIDIA drivers, reinstall your NVIDIA drivers with the current kernel (in init 3 of course), reboot and all good!

AGAIN This is just what worked for me, your mileage may vary and i take no responsibility for any harm done or files lost if you try this on your own system.

-Nick

5 Likes

@ nmaludy

Many thanks for your help!
Unfortunately, I have already switched to Debian.

Thanks so much for your help.

I followed your steps and managed to switch one of my boxes from CentOS Stream back to CentOS Linux 8 successfully. I was lucky that I did not have the login issue as you had experienced so I did not have to do those last steps.

One note though that I had to update the link in the first wget from http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.3-1.2011.el8.noarch.rpm to http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.4-1.2105.el8.noarch.rpm
That’s the only change I made.

Once again thanks you, you have saved my day.

1 Like

Huge thank you for this post which pointed me in the correct direction for fixing a botched attempt at converting my NextCloud box from Centos 8 to Rocky Linux due to some issues with installed packages.

I resolved the package issues by using dnf update --allowerasing. I also had to add --releasever 8 as dnf was now complaining about not being able to determine the release version

I then rebooted but the conversion attempt left me with an unbootable server due to a missing grubx64.efi file. I managed to fix this by booting up a recovery console from the Rocky Linux DVD and then copying over the grubx64.efi from the one left in the /boot/efi/EFI/centos folder to the /boot/efi/EFI/rocky folder.
There was also a problem with SwitchRoot complaining about os-release being missing. I think I fixed this by copying the relevant file over from the Rocky installation DVD and setting the necessary symlinks up again.

Now with the system booting again, albeit I suspect in a sort of hybrid CentOS / Rocky Linux set up, I attempted to run the migrate2rocky script once more. The script now started complaining about being unable to determine the release version as well and would not complete.
At this point I started thinking how to get the system back to a vanilla CentOS 8 set up.
Your post helped me massively with this task.
The one main difference for me was that I also had to wget and install the centos-gpg-keys-8-2.el8.noarch.rpm file from the CentOS mirror before I could install the other 2 RPMs that you mentioned.

I was then able to run dnf distro-sync with no trouble at all. I then rebooted and ran the migrate2rocky script, this time it completed as expected. I rebooted again for good measure and I’m pleased to announce it looks as though the conversion has gone through perfectly!!

There are issues attempting to switch from CentOS stream 8 to any EL8, namely that versions of certain programs will end up going down and this can (and has been known to) cause some issues with compatibility with some configuration files.

Basically put when some programs get downgraded the older version of the program can no longer read the config file that was written by the newer version of the program, and that program may refuse to start or may appear to work but have other, hidden, undefined issues that will crop up later.

I am currently working on a solution that will allow migrate2rocky to work to migrate from CentOS stream 8 by keeping the newer versions of programs from CentOS stream until a new point release drops from RockyLinux and they can be safely upgraded, thus avoiding the issues with downgrading those programs.

2 Likes

@caletron , me too. I don’t have login issue and only needed to install the 8.4 release rpm.

  1. Download two RPMs

r1=http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.4-1.2105.el8.noarch.rpm

wget $r1

r2=http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm

wget $r2

  1. remove existing centos-stream repos

sudo rpm -e --nodeps centos-stream-release centos-stream-repos

sudo rpm -ivh centos-linux-release-8.4-1.2105.el8.noarch.rpm centos-linux-repos-8-2.el8.noarch.rpm

  1. Distrosync (i had to run with --allowerasing in order for it to run)

sudo yum distro-sync --allowerasing -y

  1. reboot

sudo reboot

  1. end

IMHO, install from scratch should be a natural option. The same procedure that you would use if your system has fatal incident.

1 Like