How to Migrate CentOS Stream to AlmaLinux

Published:17 October 2022 - 4 min. read

Michael Nguyen Tu Image

Michael Nguyen Tu

Read more tutorials by Michael Nguyen Tu!

Azure Cloud Labs: these FREE, on‑demand Azure Cloud Labs will get you into a real‑world environment and account, walking you through step‑by‑step how to best protect, secure, and recover Azure data.

The CentOS project has announced the end of life for CentOS 8. There will be no more updates or security patches for Centos 8. If you tried CentOS Stream as a replacement, you might not feel confident about its stability since you can consider it a nightly build.

CentOS Stream might be excellent as a test bed but not entirely for production if you strive for a stable operating system. What’s the alternative? AlmaLinux is a good choice for those who want to stay with a Red Hat-compatible distribution.

AlmaLinux makes you feel at home since it’s almost identical to CentOS. This tutorial will teach you how to migrate your CentOS Stream to AlmaLinux.

Prerequisites

This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have a CentOS 8 Stream system ready to go. This tutorial uses an Azure VM with CentOS Stream 8.0, but the instructions will also work with CentOS 8.4 and 8.5.

Consider creating a backup of your current system so that you have a restore point if something goes wrong during the migration. The backup method differs depending on where you host your machine.

Most cloud providers offer backup or snapshot features. For example, you can create a snapshot of a virtual hard disk in Azure or Amazon EC2 backup and recovery with snapshots and AMIs in AWS.

Migrating Centos Stream to AlmaLinux

You could manually migrate Centos Stream to AlmaLinux, which requires downgrading, removing keys and branding details, installing the new OS, and reconfiguring. The manual method is tedious and prone to human errors.

On the other hand, the deployment script method makes the migration more consistent and convenient. And in this section, you’ll learn the deployment script method.

Downloading the CentOS Stream to AlmaLinux Migration Script

The AlmaLinux migration script is available for download from GitHub. To download the script, follow these steps:

1. Open your preferred SSH client and sign in to your CentOS machine.

2. Run the below command to download the deployment script from the almalinux-deploy GitHub repository.

curl -O https://raw.githubusercontent.com/philrandal/almalinux-deploy/master/almalinux-deploy.sh
Downloading the deployment script
Downloading the deployment script

3. Run the below command to verify the script you downloaded exists in the current directory.

ls -la almalinux-deploy.sh
List the downloaded script
List the downloaded script

Executing the CentOS Stream to AlmaLinux Migration Script

Follow these steps when you’re ready to start the CentOS Stream to AlmaLinux migration.

1. First, run the below command to check your Centos Stream version. Ensure that you’re current OS is Centos Stream 8. The migration script requires CentOS 8.4, 8.5, or CentOS Stream 8.

cat /etc/os-release

As you can see below, this computer runs CentOS Stream 8.

Checking your CentOS Stream version
Checking your CentOS Stream version

2. Update the packages to ensure you have the latest version before migrating CentOS Stream to AlmaLinux.

sudo dnf update -y

3. Reboot your system to apply the updates. SSH into the VM again after the reboot.

sudo reboot
Reboot CentOS Stream after the update
Reboot CentOS Stream after the update

4. Next, run the chmod command below to make the migration script executable. By default, Linux treats all downloaded files as text files. Unless the file is executable, you cannot run it.

sudo chmod +x almalinux-deploy.sh

5. Execute the script with the below command. The script starts the CentOS Stream to AlmaLinux migration and might take several minutes to complete.

sudo bash almalinux-deploy.sh
Executing the CentOS Stream to AlmaLinux Migration Script
Executing the CentOS Stream to AlmaLinux Migration Script

This script ran for approximately 20 minutes in this example. After migration, you will see an output similar to the one below. This output shows that the migration process was successful, and your computer is now running AlmaLinux 8 as its OS.

CentOS Stream to AlmaLinux Migration completed
CentOS Stream to AlmaLinux Migration completed

6. Run the below command to synchronize the local cache with the remote repositories and clean up the cache. This step will ensure that you have the latest AlmaLinux packages installed on your system.

sudo dnf distro-sync -y && sudo dnf clean all
Synchronizing the local cache with the remote repositories
Synchronizing the local cache with the remote repositories

Verifying the Successful CentOS Stream to AlmaLinux Migration

Now that the migration process is complete, you must confirm that everything is working as expected. Several steps will help ensure your system is indeed running on AlmaLinux.

1. Run the below command to confirm the computer’s current OS release.

cat /etc/os-release

At the time of writing, AlmaLinux 8.6 is the latest release, and Sky Tiger is the code name.

Displaying the Linux OS version
Displaying the Linux OS version

2. Run the below command to check the default loaded kernel. The output will show AlmaLinux as the default kernel, as shown below. This step is vital since your computer needs the AlmaLinux kernel to boot.

sudo grubby --info DEFAULT | grep AlmaLinux

As you can see below, this computer has the AlmaLinux (4.18.0-372.26.1.el8_6.x86_64) 8.6 (Sky Tiger) kernel loaded.

Checking the default loaded kernel
Checking the default loaded kernel

3. Using a desktop environment, you can verify the migration by logging in to the system. This time, you will see an AlmaLinux logo on the login screen instead of the CentOS logo.

Provide your user credentials and click the Sign in button to log into your system. You should now see AlmaLinux running as shown.

Sign in to AlmaLinux desktop environment
Sign in to AlmaLinux desktop environment

And you should see the AlmaLinux desktop environment. AlmaLinux comes with the GNOME desktop environment by default.

Logging in to the system
Logging in to the system

Conclusion

AlmaLinux is the community-driven fork of Centos Linux. The goal of AlmaLinux is to provide a rock-solid and stable platform that is supported for at least ten years. AlmaLinux also aims to provide timely security updates and regular bug fixes to keep users safe and productive.

This tutorial taught you how to migrate from Centos Stream to AlmaLinux using a deployment script. Once the migration is complete, AlmaLinux will run on your system, and you can start using it as your default Linux distribution.

You can now stop worrying about the CentOS end-of-life. With AlmaLinux, you can rest assured that your system will be in a supported state for a long time to come. So give AlmaLinux a try and see how stable and reliable it is. You won’t be disappointed!

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Explore ATA Guidebooks

Looks like you're offline!