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.

<img alt="Hitesh Jethva" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/07/echo/hitesh-80.jpg" ezimgfmt="rs rscb3 src ng ngcb3" src="data:image/svg xml,”>

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.