Migrate from CentOS 8.x to Rocky Linux 8.x | 1 Easy guide


In our today’s guide let’s see how to migrate from CentOS to Rocky Linux. The current version of CentOS in my production server is 8.3.x, Let’s see how to migrate from CentOS 8.3 to Rocky Linux 8.4.

Before starting with the upgrade, make sure to take a complete backup to restore in case if we face any upgrade issues.

If you are looking for a fresh OS installation, a step-by-step guide is available below.

Step by step Rocky Linux 8.x Installation easy guide with screenshots

Current Installed OS Version

The current version in my prod server is

prod-server-west-1 ~]# cat /etc/redhat-release
CentOS Linux release 8.3.2011
[root@prod-server-west-1 ~]#

It’s been for a long time I have been planned to upgrade.

[root@prod-server-west-1 ~]# uptime
 02:51:13 up 164 days, 23:03,  1 user,  load average: 0.48, 0.30, 0.24
[root@prod-server-west-1 ~]#

Before performing the distribution upgrade, let’s upgrade to the current version of CentOS by running

# dnf update -y

Right after the upgrade, take a reboot and verify the latest installed minor release version.

# reboot

Output for reference after the reboot.

[root@prod-server-west-1 ~]# cat /etc/redhat-release 
CentOS Linux release 8.4.2105
[root@prod-server-west-1 ~]#

Preparing for Migration

To migrate from CentOS to Rocky Linux the easiest way is to remove the following packages and install the same packages from the Rocky Linux yum repository.

While removing the package, we need to skip removing the dependencies by using the option --nodeps.

# rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos

Getting & Installing Packages

Now it’s time to download the required Rocky Linux packages from the official repository.

If you have a different version of a minor release version, then navigate to the below URL to download the appropriate packages.


Get the Rocky Linux release, repos, and GPG-key RPM packages.

# wget https://download.rockylinux.org/pub/rocky/8.4/BaseOS/x86_64/os/Packages/rocky-release-8.4-32.el8.noarch.rpm
# wget https://download.rockylinux.org/pub/rocky/8.4/BaseOS/x86_64/os/Packages/rocky-repos-8.4-32.el8.noarch.rpm
# wget https://download.rockylinux.org/pub/rocky/8.4/BaseOS/x86_64/os/Packages/rocky-gpg-keys-8.4-32.el8.noarch.rpm

Install all downloaded packages by running the rpm command.

# rpm -ivh rocky-*

That’s it, we have almost done with 85%.

Migrate from CentOS to Rocky Linux

Finally, Run the distro-sync command to upgrade the latest version of already installed packages.

# dnf distro-sync -y

This stage will take a long time to download and install the required packages.

At last, we are good with the upgrade.

[root@prod-server-west-1 ~]# cat /etc/redhat-release 
Rocky Linux release 8.4 (Green Obsidian)
[root@prod-server-west-1 ~]#

Smooth and fine, Everything works. For your information, the guide which you are reading right now is hosted on a webserver migrated from CentOS to Rocky Linux 8.4.


A straight walk-through guide to migrate from CentOS 8.x to Rocky Linux 8.4, Will post more guides related to Rocky Linux soon. Subscribe to the newsletter and say tune for the updates. Your feedbacks are welcome through the below command section.