How to Migrate Centos 8 to AlmaLinux 8.3

CentOS 8 will reach end-of-life on December 31, 2021. So if you are using CentOS 8 operating system then it is recommended to upgrade it to centos alternative distributions named Alma Linux.

In this guide, we will show you how to migrate CentOS 8 to the new AlmaLinux 8.3.

Prerequisites

  • A server running CentOS 8.
  • A root password is configured on the server.

Verify Your Current Operating System

First, you can verify your current operating system version with the following command:

hostnamectl

You should see the following output:

   Static hostname: centos
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 2c4021b827b14dc09dffcd6a602a70dd
           Boot ID: 817d7159c1c345b19d4bfafa8b6ddb60
    Virtualization: kvm
  Operating System: ]8;;https://www.centos.org/CentOS Linux 8 (Core)]8;;
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-193.6.3.el8_2.x86_64
      Architecture: x86-64

You can also run the following command to check your operating system version:

cat /etc/os-release

You should see the following output:

NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

Update Your System Packages

Before starting the upgrade process, you will need to update all the packages to the latest version. You can update all of them using the following command:

dnf update -y

Once all the packages are updated, restart your system to apply the update.

reboot

Upgrade From CentOS 8 to AlmaLinux Manually

First, you will need to remove all CentOS gpg keys, repositories, and branding details.

If you are running CentOS 8 Desktop operating system, remove all of them with the following command:

rpm -e --nodeps centos-backgrounds centos-indexhtml centos-gpg-keys centos-linux-release centos-linux-repos centos-logos

If you are running CentOS 8 server operating system, remove all of them with the following command:

rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos

After removing all of them, run the following command to install the AlmaLinux release package.

rpm -ivh https://repo.almalinux.org/almalinux/8.3-beta/BaseOS/x86_64/os/Packages/almalinux-release-8.3-2.el8.x86_64.rpm

Next, run the following command to upgrade from CentOS 8 to Alma Linux.

dnf distro-sync -y

Once the migration process is completed, restart your system to apply the changes:

reboot

After restarting, verify your operating system version using the following command:

cat /etc/os-release

You should see your new operating system in the following output:

NAME="AlmaLinux"
VERSION="8.3 (Purple Manul)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.3 RC (Purple Manul)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.3:rc"
HOME_URL="https://almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.3"

Upgrade From CentOS 8 to AlmaLinux with Almalinux-deploy Script

Alma Linux provides a almalinux-deploy.sh script to upgrade CentOS 8 to AlmaLinux automatically.

First, update your system packages with the following command:

dnf update -y

After updating all the packages, restart your system to apply the changes:

reboot

Next, download the almalinux-deploy.sh script using the following command:

curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh

Next, run the downloaded script to upgrade your CentOS 8 to AlmaLinux:

bash almalinux-deploy.sh

Once the upgrade process is completed successfully, you should see the following output:

Run dnf distro-sync -y                                                OK
Restoring of alternatives is done                                     OK
Generating grub configuration file ...
done
All Secure Boot related packages which were released by not AlmaLinux are reinstalledOK

Migration to AlmaLinux is completed

Next, restart your system to apply the changes:

reboot

Next, run the following command to verify your operating system.

cat /etc/os-release

You should get the following output:

NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
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.4"

You can also check the loaded kernel version using the following command:

grubby --info DEFAULT | grep AlmaLinux

You should get the following output:

title="AlmaLinux (4.18.0-305.3.1.el8_4.x86_64) 8.4 (Electric Cheetah)"

Conclusion

Congratulations! you have successfully upgrade your CentOS 8 to AlmaLinux 8. I hope this tutorial will help you to upgrade your live system.

Share this page:

Suggested articles

2 Comment(s)

Add comment

Comments

By: Taleman at: 2021-07-10 16:00:16

Is Alma Linux the only successor to CentOS 8?

By: exynenem at: 2021-07-20 11:57:06

Alma Linux (or the commercial pendant CloudLinux) isn't actually a real successor to CentOS 8. It continues to be a real rebuild of RHEL 8 without cut support cycle unlike CentOS 8 (Stream). Rocky Linux 8 is following the same route as Alma Linux and rebuilds the source packages from RHEL 8.Then there are a few more niche rebuilds/clones of CentOS/RHEL 6/7/8 for example from Oracle, Virtuozzo, Springdale, CERN/Scientific Linux etc but I don't think that they will play a big role in the future. My prediction for the race/competition between EL8 and its clones will be: Alma Linux / CloudLinuxRocky LinuxRHEL itself (since it's possible to run RHEL on up to 16 machines without paying anything) CentOS Stream ( eventhough it has it support cycle cut down from 10 years to something like ~5 years)

 

I'm not sure yet to which distribution I should convert my CentOS 8 machines by the end of the year but I tend atm more to Alma Linux and partially RHEL (some machines).

Even CentOS Stream is actually still fine, as long as one doesn't plan to use this distribution for longer than the current support cycle.