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?
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.
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.
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.
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.
CentOS Stream 8 to Rocky 8 conversion is supported now. What it does is leave the Stream 8 packages in place and leaves the repos for Stream 8 disabled. This means that those packages will not get updated until Rocky Linux moves to the next point release at which point they should get automatically replaced with the Rocky Linux packages on the next update. This avoids actually downgrading packages in the migration.
How can i safe migrate form Centos to Rocky?
Is it 100% working?
Can I risk on working 24/7 machine? Is it safe?
I can’t stop machine and try many different rules, manulay mounting, manualy change many files for migrate - isn’t possible for this moment.
I can’t risk that something will be wrong and machine past reboot don’t more wake up.
Actualy:
yum repolist
identyfikator repozytorium nazwa repozytorium
appstream CentOS Linux 8 - AppStream
baseos CentOS Linux 8 - BaseOS
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras CentOS Linux 8 - Extras
cat /etc/*-release
CentOS Linux release 8.3.2011
NAME=“CentOS Linux”
VERSION=“8”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“8”
PLATFORM_ID=“platform:el8”
PRETTY_NAME=“CentOS Linux 8”
ANSI_COLOR=“0;31”
CPE_NAME=“cpe:/o:centos:centos:8”
HOME_URL=“https://centos.org/”
BUG_REPORT_URL=“https://bugs.centos.org/”
CENTOS_MANTISBT_PROJECT=“CentOS-8”
CENTOS_MANTISBT_PROJECT_VERSION=“8”
CentOS Linux release 8.3.2011
CentOS Linux release 8.3.2011
I used the howto here which worked for me, but mind you don’t do anything daft™…
The only caveat I would add would be to add the --allowerasing switch to dnf dsync, though I wouldn’t add -y but instead interrogate carefully anything that is to be erased.
Thanks