Wednesday, October 13

Migrate CentOS 8 to Rocky Linux 8

Rocky Linux is a new Linux distro that was born to fill the void that the passing of CentOS has open. It was also the first CentOS replacement to be announced following the news from Red Hat.

Rocky Linux is a community enterprise operating system designed to be 100% compatible with RedHat Enterprise Linux. As of writing this guide, Rocky Linux 8.4 is available for x86_64 bit and ARM64 (aarch64) architectures.

Download Rocky Linux

Rocky Linux dev team has created a migration script called migrate2rocky to easily convert an existing CentOS 8 system to Rocky Linux 8.

Step 1: Upgrade the current CentOS 8 Linux system to latest available version:

[root@linuxhawks ~]# dnf --refresh upgrade

After update is complete, reboot your system

[root@linuxhawks ~]# reboot

Step 2: Check the current version of CentOS 8:

[root@linuxhawks ~]# cat /etc/redhat-release
CentOS Linux release 8.3.2011

Step 3: Download Rocky Linux migration script named migrate2rocky:

[root@linuxhawks ~]# curl -O
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
 100 27652  100 27652    0     0  38458      0 --:--:-- --:--:-- --:--:-- 38405

Step 4: Make the migrate2rocky script executable:

[root@linuxhawks ~]# chmod +x 

Step 5: Finally, run migrate2rocky script with -r switch to migrate to Rocky Linux 8 from CentOS 8 Linux system using the command:

[root@linuxhawks ~]# ./ -r
 Preparing to migrate CentOS Linux 8 to Rocky Linux 8.
 Determining repository names for CentOS Linux 8…..
 Found the following repositories which map from CentOS Linux 8 to Rocky Linux 8:
 CentOS Linux 8  Rocky Linux 8
 appstream       appstream
 baseos          baseos
 extras          extras
 Getting system package names for CentOS Linux 8

This will replace CentOS 8 repositories with Rocky Linux repositories, remove CentOS branding, add Rocky Linux GPG keys, and then download, install and upgrade all packages.

 Subscription Manager found on system.
 If you're converting from a subscription-managed distribution such as RHEL then
 you may no longer need subscription-manager or dnf-plugin-subscription-manager.
 While it won't hurt anything to have it on your system you may be able to safely
 remove it with:
 "dnf remove subscription-manager dnf-plugin-subscription-manager".
 Take care that it doesn't remove something that you want to keep.
 The subscription-manager dnf plugin may be enabled for the benefit of
 Subscription Management. If no longer desired, you can use
 "subscription-manager config --rhsm.auto_enable_yum_plugins=0" to block this
 Done, please reboot your system.
 A log of this installation can be found at /var/log/migrate2rocky.log

Step 6: Run the following command to synchronize installed packages to the latest available versions.

[root@linuxhawks ~]# dnf distro-sync -y
 Last metadata expiration check: 0:34:11 ago on Sun 27 Jun 2021 03:24:44 PM EDT.
 Dependencies resolved.
 Nothing to do.

[root@linuxhawks ~]# reboot

Step 7: Check the migrated version:

[root@linuxhawks ~]# cat /etc/redhat-release
Rocky Linux release 8.4 (Green Obsidian)

[root@linuxhawks ~]# cat /etc/os-release
 NAME="Rocky Linux"
 VERSION="8.4 (Green Obsidian)"
 ID_LIKE="rhel fedora"
 PRETTY_NAME="Rocky Linux 8.4 (Green Obsidian)"

Finally, it has been updated. Here is my Rocky Linux 8.4 system running on Hyper-V after successfully migrated from CentOS 8.3.

Leave a Reply

Your email address will not be published. Required fields are marked *


Enjoy this blog? Please spread the word :)