In December 2021 CentOS 8 reached its end of life (EOL). If your server is still running CentOS 8, it no longer receives security updates. An urgent migration is required.
Comparison of CentOS successors
| Distribution | Sponsor | Versions | EOL (v9) |
|---|---|---|---|
| Rocky Linux | Rocky Enterprise Software Foundation | 8, 9 | 2032 |
| AlmaLinux | CloudLinux | 8, 9 | 2032 |
| CentOS Stream | Red Hat | 9, 10 | 2027 |
| RHEL (paid) | Red Hat | 8, 9 | 2032 |
Migrating CentOS 8 → AlmaLinux 8
# Download the official migration script
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
# Run it (always inside screen!)
sudo screen -S migration
sudo bash almalinux-deploy.sh
# When it finishes — reboot
sudo reboot
# Check the result
cat /etc/almalinux-release
rpm -qa | grep almalinux
Migrating CentOS 8 → Rocky Linux 8
# Download the migrate2rocky script
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
# Run it inside screen
sudo screen -S migration
sudo bash migrate2rocky.sh -r
# Reboot and verify
sudo reboot
cat /etc/rocky-release
After the migration
# Update all packages
sudo dnf update -y
# Check the repositories
dnf repolist
# Check the kernel
uname -r
rpm -q kernel
Diagnosing common migration errors
The almalinux-deploy.sh script fails with "Failed to synchronize cache" — this usually means the old CentOS 8 repositories are already gone (mirrorlist.centos.org was shut down after EOL), and dnf cannot refresh metadata before the repositories get swapped.
Errors during downloading metadata for repository 'base':
- Status code: 404 for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS
Error: Failed to download metadata for repo 'base'
The fix is to first manually point the repositories at vault.centos.org (the archive) so dnf can download anything at all, and only then run the migration script.
sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
After migration, "dnf update" says "Problem: package X requires Y, but none of the providers can be installed" — a sign that some packages are still from CentOS (for example the kernel or a third-party module) while others are already from AlmaLinux/Rocky, and the versions clash.
Problem: package kernel-core-4.18.0-305.el8.x86_64 requires kernel-modules = 4.18.0-305.el8, but none of the providers can be installed
sudo dnf distro-sync usually fixes this — the command brings all packages to the versions of a single distribution instead of just updating them individually.
Migration paths compared
| Method | Effort | Risk | When to choose it |
|---|---|---|---|
| Migration script (almalinux-deploy / migrate2rocky) | Minutes | Moderate, depends on custom packages | A standard server with nothing exotic |
| New server plus data transfer | Hours (moving the database, configs) | Low for the system | Production with high stability requirements |
| Switch to CentOS Stream | Minutes | High - rolling release, less predictable | Test environments, not production |
When a script migration is not the right call
- The server has many custom packages from third-party repositories (EPEL forks, self-built RPMs) — the script may not handle the dependencies well, so moving data to a clean server is safer.
- You need a guaranteed vendor support contract — Rocky and AlmaLinux are free but come with no commercial SLA; that requires RHEL specifically.
- The server has not been updated for a long time and mixes packages from different CentOS 8.x minor versions — run
dnf updateon CentOS to the latest minor first, otherwise the script can fail with dependency errors.
Verifying the result
- Confirm the release changed:
cat /etc/os-releasemust show AlmaLinux or Rocky Linux, not CentOS. - Check for CentOS leftovers:
rpm -qa | grep -i centos— the command must return no packages (aside from any centos-release-like package deliberately kept). - Run a full update and confirm there are no conflicts:
sudo dnf distro-syncmust finish with no errors. - Check the key services:
systemctl status nginx mariadb— both must showactive (running)after reboot.
After migrating, check the kernel version — see the article on updating the kernel, and the general planned OS update process is covered in the VDS update guide.