AlmaLinux OS is a new RHEL fork from the team at CloudLinux. It is meant to be a free Linux Operating System, developed in close co-operation with the community, and for the community. As of this article update, the release of AlmaLinux available is not stable fit for production use. AlmaLinux OS is now stable and can be used in Production environments. We will see how to migrate CentOS 8 to AlmaLinux 8 operating system.
AlmaLinux OS is an open-source, community-driven project that intends to fill the gap left by the demise of the CentOS stable release. AlmaLinux OS is a 1:1 binary compatible fork of RHEL® 8 and it is built by the creators of the established CloudLinux OS. AlmaLinux OS is an enterprise-grade server OS, a stable Linux distribution with regular releases that come with long support windows. You can rely on AlmaLinux OS to run you and your clients’ critical workloads.
In this short article we show Linux users how to convert CentOS 8 To AlmaLinux 8 Server using almalinux-deploy bash script. You should have a running instance of CentOS 8 machine before you proceed.
Step 1: Login to CentOS 8 system
SSH into your CentOS 8 server.
ssh username@serverip
Check the OS release to confirm this a CentOS 8 OS.
$ 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"
$ cat /etc/redhat-release
CentOS Linux release 8.3.2011
We can confirm the release is 8.3.2011.
Step 2: Disable Secure Boot
If you’re running on a hardware with Secure Boot you need to disable it. This is because AlmaLinux doesn’t support it yet (almbz#3). Detailed instructions for bare metal hardware can be found here. Instructions for VMWare are available here.
Step 3: Migrate from CentOS 8 To AlmaLinux 8
As of January 31, 2022 the CentOS 8 mirrorlists are offline. In order to successfully perform dnf update -y you need to update your dnf config files to point to a valid mirror. You can use the following sed commands for convenience to restore dnf to a functional state that will let you update to 8 and subsequently AlmaLinux.
curl -O https://raw.githubusercontent.com/jmutai/scripts/main/linux/centos_8_vault_mirrors.sh
chmod +x centos_8_vault_mirrors.sh
sudo ./centos_8_vault_mirrors.sh
Download the almalinux-deploy.sh script:
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Give the script execution bits.
chmod +x almalinux-deploy.sh
Then run the script with the commands below.
sudo ./almalinux-deploy.sh
The conversion should begin immediately.
....
Check root privileges OK
Check Secure Boot disabled OK
Check centos-8.x86_64 is supported OK
Download RPM-GPG-KEY-AlmaLinux OK
Import RPM-GPG-KEY-AlmaLinux to RPM DB OK
Download almalinux-release package OK
Verify almalinux-release package OK
warning: /etc/dnf/vars/infra saved as /etc/dnf/vars/infra.rpmsave
Remove centos-linux-release package OK
Remove centos-gpg-keys package OK
Remove centos-linux-repos package OK
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:almalinux-release-8.3-3.el8 ################################# [100%]
Install almalinux-release package OK
Remove centos-logos package OK
Install almalinux-logos package OK
Last metadata expiration check: 0:00:02 ago on Tue 09 Mar 2021 08:32:46 PM UTC.
Dependencies resolved.
.....
If this was successful you should get below message at the end.
...
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
Confirm that your CentOS 8 system was successfully converted to AlmaLinux 8:
$ cat /etc/os-release
NAME="AlmaLinux"
VERSION="8.6 (Sky Tiger)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.6 (Sky Tiger)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
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.6"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"
$ cat /etc/redhat-release
AlmaLinux release 8.6 (Sky Tiger)
Reboot the system to confirm it works:
$ sudo reboot
Checking repolist:
$ yum repolist
repo id repo name
appstream AlmaLinux 8 - AppStream
baseos AlmaLinux 8 - BaseOS
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras AlmaLinux 8 - Extras
remi-modular Remi's Modular repository for Enterprise Linux 8 - x86_64
remi-safe Safe Remi's RPM repository for Enterprise Linux 8 - x86_64
Repolist file:
$ cat /etc/yum.repos.d/almalinux.repo
You have converted CentOS 8 to AlmaLinux 8. In our future guides we will cover AlmaLinux 8 Server administration. Stay connected for updates.
More guides.