CentOS Linux 8 was discontinued at the end of 2021. Check out more information about that in this in this article CentOS Linux 8 will end in 2021 and shifts focus to CentOS Stream.
The team at CentOS decided to shift focus to CentOS stream, an upstream version of RHEL. CentOS stream places itself between Fedora Linux and RHEL. It is not 100% RHEL clone but ahead of RHEL development. Other distros that are 100% compatible with RHEL 8 have come up including Rocky Linux and Alma Linux.
In this guide, we will learn how to convert an existing CentOS 8 distribution into Alma Linux without reinstalling a new operating system. The Alma Linux team provides an automated script for this purpose. An in-place upgrade does not require formatting of hard disk and due to that fact all settings, programs, and files on your current CentOS 8 system will be preserved.
Table of Content
- Ensure your system is up to date
- Backup your CentOS Linux system
- Install CentOS Stream package
- Download the Official AlmaLinux Migration Script
1. Ensure your system is up to date
Ensure that the server is updated using this command:
sudo dnf update -y
Let us also verify CentOS Linux 8 version using this command:
$ cat /etc/os-release 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"
2. Backup your CentOS 8 system
It is a good practice to ensure periodic updates on your system. If you have application data in the system ensure that it is backed up. Please also make OS snapshot to revert back when something goes wrong. Always keep verified backups.
3. Download the Official AlmaLinux Migration Script
The AlmaLinux team provides a migration tool that will help in the process. The tool is found in this github repository.
Download the almalinux-deploy.sh script:
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Next, make the script executable:
chmod +x almalinux-deploy.sh
4. Migrate from CentOS 8 to AlmaLinux 8
Finally, with the script available locally, run it to to start migration process:
sudo bash almalinux-deploy.sh
After the migration script performs a few initial checks, it will begin the process of upgrading certain packages in order to synchronize the system with the current AlmaLinux 8 release.
Be patient since the upgrade process could take some time. Upon completion you should see success message
... Complete! Run dnf distro-sync -y OK Restoring of alternatives is done OK Generating grub configuration file ... done All Secure Boot related packages which were not released by AlmaLinux are reinstalledOK Migration to AlmaLinux is completed
Reboot the system to apply kernel changes
5. Check AlmaLinux Version to Validate Migration
Just to confirm that you have successfully migrated, check the OS version:
$ cat /etc/os-release NAME="AlmaLinux" VERSION="8.5 (Arctic Sphynx)" ID="almalinux" ID_LIKE="rhel centos fedora" VERSION_ID="8.5" PLATFORM_ID="platform:el8" PRETTY_NAME="AlmaLinux 8.5 (Arctic Sphynx)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos" HOME_URL="https://almalinux.org/" DOCUMENTATION_URL="https://wiki.almalinux.org/" BUG_REPORT_URL="https://bugs.almalinux.org/" ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8" ALMALINUX_MANTISBT_PROJECT_VERSION="8.5"
That’s all. Congratulations! You have successfully converted CentOS 8 to AlmaLinux 8.
Check that the system boots AlmaLinux kernel by default:
$ sudo grubby --info DEFAULT | grep AlmaLinux title="AlmaLinux (4.18.0-348.12.2.el8_5.x86_64) 8.5 (Arctic Sphynx)"
Please note that the
almalinux-deploy.sh script will only convert CentOS 8 version to AlmaLinux 8.