Introduction
RedHat has discontinued CentOS 8, and it has reached End-of-Life status as of December 31, 2021. CentOS 8 servers should be converted to AlmaLinux or Rocky Linux to maintain updates and support.
Procedure
As the CentOS 8 repositories have been archived, you will need to first adjust the CentOS base repository. You must modify the file:
/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
The mirrorlist pointing to "mirrorlist.centos.org" must be updated to point to "vault.centos.org" to download any packages.
The following sed command will replace this URL in one step:
cp /etc/yum.repos.d/CentOS-Linux-BaseOS.repo{,.$(date +%s)} && sed 's/mirrorlist\.centos\.org/vault\.centos\.org/g' -i /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
After this, update your system:
dnf clean all
dnf -y update
Then, after updating, reboot the server to ensure the latest kernel is loaded:
reboot
Now that the system is up-to-date, we can begin by downloading the conversion utility:
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
Then we can run this utility:
bash almalinux-deploy.sh
Once the process finishes, review the output for any errors. A successful run will complete with the following:
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 released by not AlmaLinux are reinstalled OK
Migration to AlmaLinux is completed
Once you've rebooted into the new system, you can verify the conversion by checking the redhat-release file:
cat /etc/redhat-release
You can also verify the correct boot entry is selected in grub:
grubby --info DEFAULT | grep AlmaLinux
The expected result will include the same version mentioned in the redhat-release file
title="AlmaLinux (4.18.0-305.el8.x86_64) 8.4"
More information about the conversion script is available in the AlmaLinux GitHub here:
Comments
0 comments
Article is closed for comments.