Migrate CentOS 8 Operating System to Rocky Linux - CentLinux


Sunday, 4 July 2021

Migrate CentOS 8 Operating System to Rocky Linux


Rocky Linux is an alternative to CentOS Linux 8. CentOS is about to meet it's early end of life on 31 Dec 2021. Therefore, you should learn how to migrate your operating systems to Rocky Linux 8.


Table of Contents:


Why Migrate to Rocky Linux?:

Rocky Linux is the most anticipated downstream fork of Red Hat Enterprise Linux 8. CentOS Linux 8 is no more, and the fans are eagerly looking for alternatives.

Rocky Linux was led by Gregory Kurtzer, founder of the CentOS project. Therefore, fans are expecting that the Rocky Linux may be the best alternative of CentOS Linux 8.

Just like CentOS, Rocky Linux is also a community enterprise operating system designed to be 100% bug-for-bug compatible with America's top enterprise Linux distribution i.e Red Hat Enterprise Linux.


Environment Specification:

We are using a minimal CentOS 8 virtual machine with following specifications.

  • CPU - 3.4 Ghz (2 cores)
  • Memory - 2 GB
  • Storage - 40 GB
  • Operating System - CentOS 8.3
  • Hostname – centos-linux-8.centlinux.com
  • IP Address - /24


Verifying Exiting CentOS Linux Operating System:

Connect with centos-linux-8.centlinux.com as root user by using a ssh client.

Check the current operating system name and version.

# cat /etc/os-release NAME="CentOS Linux" VERSION="8" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8"

Query the Linux Kernel version by using uname command.

# uname -r 4.18.0-240.1.1.el8_3.x86_64


Migrating to Rocky Linux 8:

Thanks to migrate2rocky.sh script, migration process of Rocky Linux is pretty straight forward. Running this script will convert an existing CentOS 8 operating system to Rocky Linux 8.

You can free download migrate2rocky.sh script from GitHub, therefore execute the wget command from your Linux command line to download it straight on your Linux server.

# wget https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh --2021-07-02 18:58:34-- https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com)...,,, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)||:443... connected. HTTP request sent, awaiting response... 200 OK Length: 28338 (28K) [text/plain] Saving to: ‘migrate2rocky.sh’ migrate2rocky.sh 100%[===================>] 27.67K --.-KB/s in 0.07s 2021-07-02 18:58:37 (410 KB/s) - ‘migrate2rocky.sh’ saved [28338/28338]

Grant execution permissions on downloaded file.

# chmod +x migrate2rocky.sh

Check the migrate2rocky.sh command usage by executing following command.

# ./migrate2rocky.sh -h Usage: migrate2rocky.sh [OPTIONS] Options: -h Display this help -r Convert to rocky -V Verify switch !! USE WITH CAUTION !!

Execute migrate2rocky.sh script to start conversion of your operating system.

# ./migrate2rocky.sh -r


This script first checks the Linux yum repositories in use, and then replace these repositories with Rocky Linux equivalent.

The migration script also look for the system packages that correspondence to the CentOS Linux branding such as logos, backgrounds and license. And then replace it with Rocky Linux equivalent to change the look and feel of your operating system.


Besides migration, the migrate2rocky.sh script also upgrades the Linux system to latest stable releases.


The script takes couple of minutes, depending upon your Internet connection speed. For us it take about 1 hour to complete. So sit back and relax for a while.

After successful completion of migration script, you need to reboot your system with the new Rocky Linux 8 Kernel.

# reboot


During reboot, your GRUB boot menu will show a new entry pertains to the new Rocky Linux 8 Kernel. Press <ENTER> to start your Linux operating system with this latest Linux Kernel.

After reboot, execute following command at Linux bash prompt to check the current operating system version and name.

# cat /etc/os-release NAME="Rocky Linux" VERSION="8.4 (Green Obsidian)" ID="rocky" ID_LIKE="rhel fedora" VERSION_ID="8.4" PLATFORM_ID="platform:el8" PRETTY_NAME="Rocky Linux 8.4 (Green Obsidian)" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:rocky:rocky:8.4:GA" HOME_URL="https://rockylinux.org/" BUG_REPORT_URL="https://bugs.rockylinux.org/" ROCKY_SUPPORT_PRODUCT="Rocky Linux" ROCKY_SUPPORT_PRODUCT_VERSION="8"

You can see that your operating system is upgraded to Rocky Linux 8.

Also check the Linux kernel version.

# uname -r 4.18.0-305.7.1.el8_4.x86_64

The script has also upgraded your Linux Kernel to the latest stable version support by your operating system.



In this guide, you have successfully migrate your CentOS Linux operating system to Rocky Linux 8. There are some other good CentOS alternatives, and you can find the respective migration guides at CentLinux.

No comments:

Post a Comment