How To Convert Centos 8 to AlmaLinux 8 – Full Migration | OrcaCore
In this guide, we want to teach you How To Convert Centos 8 to AlmaLinux 8. We understand the importance of a smooth transition, especially with the changes in the CentOS landscape.
As you know, RedHat supports the Centos project for some time, and we will no longer have stable Centos after Centos 8. This shift has led many users to seek reliable alternatives.
One of the companies that relied on Centos products decided to release a Linux distribution like CentOS. This distribution is called AlmaLinux OS, which is exactly the same as Centos based on RedHat.
This distribution is in the form of a Stable Release, and packages are placed in updates that are more suitable for servers than Rolling Release distributions. For users seeking a stable and predictable environment, AlmaLinux offers a compelling option.
To get more information, you can check our article Introducing AlmaLinux As a Replacement for CentOS.
In this article, we decide to teach you to convert your Centos 8 to AlmaLinux 8. The goal is to provide a straightforward method for migrating your existing CentOS 8 systems to AlmaLinux 8, minimizing downtime and ensuring a seamless experience.
Before you start to complete this guide, log in to your Centos 8 as a root user or a non-root user with sudo privileges. Proper authentication is crucial for executing the necessary commands.
Now you can follow the steps below to migrate from Centos to AlmaLinux. Let’s dive into the process of converting CentOS 8 to AlmaLinux 8.
Migrate from Centos 8 to AlmaLinux 8
First, you need to update your local package index with the following command:
sudo dnf update
Then, reboot your server with the command below:
reboot
Next, you need to download the AlmaLinux deploy script by using the wget or curl command:
sudo wget https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Now you need to set the correct permissions for this file with the following command:
sudo chmod -v +x almalinux-deploy.sh
At this point, you can migrate Centos 8 to AlmaLinux 8 by running the AlmaLinux deploy script:
./almalinux-deploy.sh
This will take some time to complete. The script automates much of the conversion process, handling repository changes and package updates.
When it is completed, you will get the following output:
**Output**
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 server:
shutdown -r now
Finally, you can verify that you have successfully migrated Centos 8 to AlmaLinux 8 by checking the AlmaLinux version with the following command:
cat /etc/redhat-release
**Output**
AlmaLinux release 8.5 (Arctic Sphynx)
Or you can use the command below instead:
cat /etc/os-release
In your output you will see:
**Output**
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"
Conclusion
At this point, you learn to Convert Centos 8 to AlmaLinux 8 with a few Linux commands and all services will run on the server without interruption. This guide provides a proven method for transitioning your CentOS 8 systems to AlmaLinux 8.
Maybe this article about How To Use YUM and RPM Package Managers on AlmaLinux 8 be useful for you. Understanding package management is essential for maintaining your AlmaLinux system.
I hope you enjoy it. Converting CentOS 8 to AlmaLinux 8 can provide a continued stable platform for your server needs.
Also, If you need to install, Set up, or configure any services about AlmaLinux you can follow the AlmaLinux Tutorials page on Orcacore.com
Alternative Methods for Converting CentOS 8 to AlmaLinux 8
While the script-based method outlined above is generally the recommended and simplest approach, there are alternative strategies for migrating from CentOS 8 to AlmaLinux 8. These alternatives are typically more involved and require a deeper understanding of the underlying system, but they can be useful in specific scenarios or for users who prefer a more manual approach.
Alternative 1: Manual Repository Configuration and Package Replacement
This method involves manually modifying the DNF repository configurations to point to AlmaLinux repositories and then using DNF to replace the CentOS packages with their AlmaLinux counterparts. This approach offers more granular control over the migration process but requires careful attention to detail to avoid dependency issues.
Explanation:
-
Backup Existing Repository Configurations: Before making any changes, it’s crucial to back up your existing CentOS repository configuration files located in
/etc/yum.repos.d/
. This allows you to revert to the original state if something goes wrong. -
Disable CentOS Repositories: Disable all the existing CentOS repositories by setting
enabled=0
in each.repo
file within/etc/yum.repos.d/
. -
Add AlmaLinux Repositories: Create new
.repo
files for AlmaLinux repositories, or modify existing ones, to include the base, updates, and extras repositories. You can find the necessary repository configurations on the AlmaLinux website. -
Clean DNF Cache: Clear the DNF cache to ensure that it picks up the new repository configurations:
sudo dnf clean all
-
Perform a Distro-Sync: Use the
dnf distro-sync
command to replace the CentOS packages with their AlmaLinux equivalents. This command attempts to synchronize the installed packages with the packages available in the configured repositories:sudo dnf distro-sync -y
-
Address Dependency Issues: During the
distro-sync
process, you may encounter dependency issues. Carefully resolve these by manually installing or removing packages as needed. DNF’s error messages will provide clues about the conflicting dependencies. -
Update Kernel and Bootloader: Ensure that the kernel and bootloader are updated to the AlmaLinux versions. This might involve reinstalling the kernel and updating the GRUB configuration.
-
Reboot and Verify: After the process is complete, reboot the system and verify that it’s running AlmaLinux by checking the
/etc/redhat-release
or/etc/os-release
file.
Code Example (Adding AlmaLinux Repositories – Example for AlmaLinux 8 Base Repo):
Create a file named /etc/yum.repos.d/almalinux-base.repo
with the following content:
[almalinux-baseos]
name=AlmaLinux 8 - BaseOS
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos
#baseurl=http://mirror.almalinux.org/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
[almalinux-baseos-debuginfo]
name=AlmaLinux 8 - BaseOS Debug
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos
#baseurl=http://mirror.almalinux.org/$releasever/BaseOS/$basearch/debug/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Alternative 2: Using a Containerized Approach
This method involves creating a new AlmaLinux container and migrating your applications and data into the container. This approach provides a clean separation between your applications and the underlying operating system, simplifying the migration process and potentially improving security. While not a direct "conversion," it achieves the same goal of moving your workloads to AlmaLinux.
Explanation:
-
Install Containerization Software: Install Docker or Podman on your CentOS 8 system.
-
Pull the AlmaLinux Image: Pull the official AlmaLinux 8 image from Docker Hub or another container registry:
docker pull almalinux:8
-
Create a Container: Create a new container from the AlmaLinux image:
docker create --name almalinux8 almalinux:8
-
Copy Data and Applications: Copy your data and applications from the CentOS 8 host into the AlmaLinux container. This can be done using
docker cp
or by mounting a shared volume between the host and the container. -
Configure Applications: Configure your applications within the container to use the AlmaLinux environment. This might involve updating configuration files or reinstalling dependencies.
-
Test and Verify: Thoroughly test your applications within the container to ensure that they are working correctly.
-
Commit and Deploy: Once you are satisfied with the container, commit the changes to create a new image. You can then deploy this image to a container orchestration platform or run it directly on a host.
Code Example (Copying data into a Docker container):
docker cp /path/to/your/data almalinux8:/path/inside/container
These alternative methods offer different approaches to migrating from CentOS 8 to AlmaLinux 8. Choose the method that best suits your needs and technical expertise. The primary "How To Convert Centos 8 to AlmaLinux 8" method involving the deploy script is still the most user-friendly and recommended for most users.