How to migrate CentOS 8 to AlmaLinux 8.3 stable (Unofficial easy way)

AlmaLinux 8 stable is out and I have already installed it and testing it. Meanwhile exploring Reddit, I got the script on "How to migrate Centos 8 to AlmaLinux 8 ". It's not the official method as the CloudLinux team has not announced anything yet. This post can be helpful if you are impatient like me. And can't wait to update Centos 8 to AlmaLinux.

Update - AlmaLinux 8.3 Stable release is out now. There is no change in the method to upgrade {Unofficial way}. All important commands have been updated in this post. The process is similar to AlmaLinux Beta and AlmaLinux stable version.

If you have not installed AlmaLinux yet. I encourage you to do so. I have written a post on how to install AlmaLinux on VMware. Also, you don't need to mess up your existing host operating system for testing.

Warning

AlmaLinux stable version has been released now but still, there is no official upgrade script, So I won't encourage you to do this migration in the production environment. I have also done it on test VM only.

CentOS to AlmaLinux Migration requirements

  • Source Operating system - CentOS 8.3 with a server group install
  • Target Operating System - AlmaLinux 8.3
  • Internet connection
  • Root or sudo access
  • Take a full backup of your server or VM

Video Tutorial

Watch out for this video on "How to migrate Centos 8 to AlmaLinux" using an unofficial way. If you like reading, then please continue further for step by step tutorial.

Migrate CentOS to AlmaLinux - unofficial way

How to Migrate Centos 8 to AlmaLinux 8.3

This guide will help you to migrate Centos 8.3 to AlmaLinux 8.3. I will be using root privileges in all commands. Follow these simple step -

Step1 - Update CentOS packages and Restart system

Update your Centos 8 packages using dnf or Yum command using root or sudo user. It's really an important step. Use option "-y", for non-interactive package upgrade.

# dnf update -y
or 
$ sudo dnf update -y
Update-centos-packages-using-dnf-update
Update centos 8 packages

Restart your CentOS system, once update is completed. You can use reboot or init 6 command.

# reboot
or
# init 6

Step2 - Remove gpg keys, repositories and branding of CentOS

Next, remove all CentOS 8 packages like index html, gpg keys, release, repositories and mirrors, branding like logos, backgrounds etc. We are not removing the dependencies of these packages. So using --nodeps option

If you have CentOS desktop system with GUI, run the below mentioned "rpm" -e command to remove all aforementioned details -

# rpm -e --nodeps centos-backgrounds centos-indexhtml centos-gpg-keys centos-linux-release centos-linux-repos centos-logos
or
$ sudo rpm -e --nodeps centos-backgrounds centos-indexhtml centos-gpg-keys centos-linux-release centos-linux-repos centos-logos
Remove-gpg-repos-branding-packages-centos-8
Remove packages with no-deps

In case you don't have GUI or GNOME installed. Run below-mentioned command to erase CentOS 8 packages like gpg keys, release and repositories only.

# rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos
or
$ sudo rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos

Step3 - Download and Install AlmaLinux 8 release package

Run following command to download and install AlmaLinux 8.3 stable release package.

# rpm -ivh https://repo.almalinux.org/almalinux/8.3/BaseOS/x86_64/os/Packages/almalinux-release-8.3-4.el8.x86_64.rpm 
or
$ sudo rpm -ivh https://repo.almalinux.org/almalinux/8.3/BaseOS/x86_64/os/Packages/almalinux-release-8.3-4.el8.x86_64.rpm
Install-AlmaLinux-8-release-package
Install AlmaLinux release package

Step4 - Remove Libreport-plugin-rhtsupport package

Before moving further, you need to remove Libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64 package using dnf command. This plugin is used for reporting the bug into the RedHat (RH) support system.

# dnf remove libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64
or 
$ sudo dnf remove libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64
libreport-plugin-rhtsupport-error-solved
Remove Libreport-plugin package

Step5 - Run dnf distro-sync command to migrate CentOS 8 to AlmaLinux

Run dnf distro-sync command to migrate CentOS 8.3 to AlmaLinux 8.3 version.

# dnf distro-sync -y
or
sudo dnf distro-sync -y
Migrate-centos-8-to-AlmaLinux-8
Sync distro

This distro sync command will delete, upgrade and downgrade existing packages. It will also clean up, install and reinstall new packages to complete the migration. For example, Install 10 packages, upgrade 75 packages and downgrade 42 packages is the transactional summary in my case.

Upgrade-packages-transactional-summary
Upgrade packages transactional summary

Just grab a cup of coffee, sit back and relax. It will take some time to upgrade depending upon your internet connection. It took around 30 minutes for me to complete migration of CentOS 8.

Libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64 Error

If you will skip Step4. You will get the following error -

" Problem: package Libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64 requires libreport = 2.9.5-15.el8 but none of the providers can be installed
- Libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64 does not belong to a distupgrade repository
-
Problem with installed package Libreport-plugin-rhtsupport-2.9.5-15.el8.x86_64 "

So make sure, you follow all steps religiously mentioned in this post.

Error output -

Libreport-plugin-rhtsupport-issue-details
Libreport-plugin error details

Step6 - Reboot your system, after migration

Once migration of Centos 8 to AlmaLinux 8 completes. Take a hygiene mandatory reboot of your system

# reboot

* Make sure you select AlmaLinux during boot.

select-AlmaLinux-8-during-boot
Choose AlmaLinux to boot

Step7 - Check AlmaLinux version to validate migration

Once reboot completes, run this command to validate your migration. It will show you AlmaLinux version 8.3 (Purple Manul) as version.

# cat /etc/os-release
check-AlmaLinux-version
Check AlmaLinux version

Hurray!! Finally, we have migrated CentOS to AlmaLinux.

Step8 (optional) - Change Hostname of your system

In my case, my test VM hostname is CentOS and I want to change it to AlmaLinux-8 now.

# hostnamectl set-hostname AlmaLinux-8
or 
$ sudo hostnamectl set-hostname AlmaLinux-8

-> Logout once and login back to see your new hostname.

How to remove CentOS grub entries and keep only AlmaLinux entries?

Follow these steps to keep AlmaLinux entries only in grub list during boot.

Grub menu entries in RHEL/CentOS 8 are assembled from various files and scripts so we won't see static entries as was the case for previous versions of the OSes. Follow these steps

Step9 - Check for all grub entries using grubby command

$ grubby --info ALL 

Step10 - Change directory to /boot/loader/entries/

You will see few files here. It was 4 in my case. 1 for AlmaLinux and 3 for CentOS and rescue boot entries

$ cd /boot/loader/entries/

Step11 - List files in this directory

$ ls 

<<output>>
e88c5a46cf0a409097a5aa5e1d2f89c8-0-rescue.conf e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.10.1.el8_3.x86_64.conf e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-193.el8.x86_64.conf e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.el8.x86_64.conf

Step12 - Move all these files to /temp except AlmaLinux ".conf" file

Check all these for files individually. Then you can move all these file except "e88c5a46cf0a409097a5aa5e1d2f89c8-4.18.0-240.el8.x86_64.conf" which is for AlmaLinux in my case, to other directory.. {Don't delete them}.

You can also keep rescue entry if you want.

Step13 - Reboot your system

Now you will see only AlmaLinux entry in (default boot).

Can I migrate CentOS 7.x or CentOS 6.x to AlmaLinux 8 ?

Yes, But it will be two step process -

  1. If you have Centos 7.x or 6.x. You need to first upgrade it to CentOS 8.3 at least to follow this migration.
  2. Then upgrade CentOS 8.3 to AlmaLinux 8.3.

Currently, there is no official way to migrate any CentOS version to AlmaLinux. CloudLinux team may come up with scripts to migrate CentOS 7.x and 6.x also to AlmaLinux 8 directly. Just assuming and hopeful 😉

Conclusion

I will make another tutorial, once the official script on "Migrate CentOS 8 to AlmaLinux" will be available. Till that time, keep testing and playing with AlmaLinux 8 version.

Although I have shared a video tutorial to explain the complete upgrade process. But if you still face any issue, just let me know through your comments. I will try to help you.

Happy learning..