This guide provides step-by-step instructions on how to easily convert Rocky Linux to RHEL using Convert2RHEL tool. Rocky Linux emerged in December 2020 after Red Hat announced the shift from CentOS Linux to CentOS Stream, leaving a gap for users who preferred a stable, free, and RHEL-compatible distribution. Created by Gregory Kurtzer, the founder of CentOS, Rocky Linux quickly gained traction as a community-driven alternative to CentOS, offering a downstream, production-grade enterprise Linux experience. It has since become popular among those seeking stability without the rolling-release model of CentOS Stream. If you’re using Rocky Linux and considering migration to RHEL, this guide is for you.
Table of Contents
Easily Convert Rocky Linux to RHEL using Convert2RHEL Tool
Why Migrating to RHEL is Paramount
While you can still switch to AlmaLinux/Rocky Linux, the most common forks of CentOS Linux, migrating entirely to RHEL comes with some benefits outlined below:
- Enhanced Security: RHEL boasts a robust security framework with regular security updates and patches, minimizing vulnerabilities and protecting your systems from threats.
- Stronger Support: With RHEL, you gain access to comprehensive support from RedHat, including expert assistance, troubleshooting, and proactive maintenance.
- Improved Stability and Reliability: RHEL is known for its stability and reliability, ensuring smooth operation and minimizing downtime.
- Enhanced Performance: RHEL is optimized for performance, delivering faster application execution and improved resource utilization.
What other Linux OS are Eligible for Conversion to RHEL?
Apart from CentOS Linux, other OSes that can be migrated or converted into RHEL include:
- Alma Linux
- Rocky Linux
- Oracle Linux
See how to migrate CentOS Linux to RHEL in the guide below;
Effortless CentOS to RHEL Migration with the Convert2RHEL Tool
Supported Conversion Paths
As of this writing, this is the current supported conversion path:
Source OS | Target OS | Architecture |
AlmaLinux 9.5 | RHEL 9.5 | 64-bit Intel |
AlmaLinux 8.10 | RHEL 8.10 | 64-bit Intel |
AlmaLinux 8.8 | RHEL 8.8 EUS | 64-bit Intel |
CentOS Linux 8.5 | RHEL 8.5 | 64-bit Intel |
CentOS Linux 7.9 | RHEL 7.9 | 64-bit Intel |
Oracle Linux 9.5 | RHEL 9.5 | 64-bit Intel |
Oracle Linux 8.10 | RHEL 8.10 | 64-bit Intel |
Oracle Linux 7.9 | RHEL 7.9 | 64-bit Intel |
Rocky Linux 9.5 | RHEL 9.5 | 64-bit Intel |
Rocky Linux 8.10 | RHEL 8.10 | 64-bit Intel |
Rocky Linux 8.8 | RHEL 8.8 EUS | 64-bit Intel |
Kindly note that it is not possible to directly convert from current source OS version e.g from Rocky Linux 8.8 to the latest available minor version of RHEL e.g RHEL 8.10. It is therefore recommended to update your system to the latest version of RHEL after the conversion.
Prerequisites for Conversion to RHEL
A summary of the prerequisites for converting to RHEL:
- Backup & Restore: Create a full system backup and ensure its restorability.
- Compatibility Check: Verify system eligibility for RHEL conversion.
- Update the original OS to the minor version supported for conversion as specified in table above. For example, if you are on Rocky Linux 8.3, then update to Rocky Linux 8.8 before conversion and then reboot the system.
- Stop Critical Services: Pause essential services to prevent data loss or corruption.
- Disable Antivirus: Temporarily disable antivirus softwareif you are running any.
- Reconfigure Configuration Management: Adjust or disable tools like Salt, Chef, Puppet, and Ansible.
- Install sos Package: Install the sos package for support case generation.
- Activate Key: Obtain an activation key from Satellite or RHSM.
- Disable Secure Boot: UEFI systems with Secure Boot enabled are not supported for conversion. Disable the same before the conversion.
- Enable Simple Content Access: Ensure SCA is enabled for accounts created after July 15, 2022.
- Access to RHEL Packages: Ensure you have access to RHEL packages either via:
- RedHat CDN via RHSM with a valid Red Hat account and subscription.
- Red Hat Satellite with RHEL 7, RHEL 8.x (AppStream and BaseOS), RHEL 9 (AppStream and BaseOS) repositories imported and synchronized.
- Custom repositories pointing to RHEL mirrors for disconnected systems. For example, if upgrading from Rocky Linux 8.10 to RHEL 8.10, you can get RHEL 8.10 DVD iso and mount locally on the host and configure custom repo on /etc/yum.repo.d/ to point to ISO mount point (AppStream/BaseOS).
- Register your System: If using Red Hat Satellite server for conversion, register your system with Red Hat Satellite. Similarly, if using RHSM, ensure you have registered your system or update your organization ID and activation key in the
/etc/convert2rhel.ini
file. - Update HTTP Proxy configuration: If you are connecting to Internet via HTTP proxy, ensure YUM/or RHSM is configured to use HTTP proxy.
What Happens During Conversion?
The Convert2RHEL
utility facilitates an in-place conversion of supported Linux distributions (like CentOS, AlmaLinux, Oracle Linux) to Red Hat Enterprise Linux (RHEL). In essence;
- The tool replaces the original distribution’s packages with their RHEL equivalents.
- Packages build from source or installed from third-party sources remain unaffected.
- Generally, user data in
/home
and/srv
directories is not directly affected. However, package scriptlets executed during the conversion process might have unintended consequences
Upgrade OS to the Latest Minor Release Version
You need to ensure that you are on the latest minor release version before you can start the migration to the supported RHEL version.
For example, we are currently running Rocky Linux 8.8;
cat /etc/redhat-release
Rocky Linux release 8.8 (Green Obsidian)
You can also use hostnamectl command to check your current OS version.
Since we are intending to migrate to RHEL 8.10, then we need to ensure that we are on Rocky Linux 8.10.
Therefore, run system update.
yum update
Once the update is done, reboot the system and confirm that it is indeed updated to the latest OS minor release version.
systemctl reboot
The reconfirm OS version;
hostnamectl
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 1497ff6a4d964a1c9020e479184fe388
Boot ID: 94c9c4ab447c46758a7e965f9cea717e
Virtualization: kvm
Operating System: Rocky Linux 8.10 (Green Obsidian)
CPE OS Name: cpe:/o:rocky:rocky:8:GA
Kernel: Linux 4.18.0-553.36.1.el8_10.x86_64
Architecture: x86-64
And we are now good to proceed with conversion.
Install Convert2RHEL Tool on Rocky Linux
To install the conversion tool, you need to install the RedHat repository providing the package.
Thus, begin by installing the repository signing key;
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release https://security.access.redhat.com/data/fd431d51.txt
Install the repository for the respective OS to upgrade to;
RHEL 7;
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-7-x86_64.repo
RHEL 8;
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-8-x86_64.repo
RHEL 9;
curl -o /etc/yum.repos.d/convert2rhel.repo https://cdn-public.redhat.com/content/public/repofiles/convert2rhel-for-rhel-9-x86_64.repo
Once the repos are in place, install the Convert2RHEL
utility:
yum -y install convert2rhel
Ensure Access to RHEL Packages
As already mentioned before, you need to ensure that you have access to RHEL packages.
In our setup, we have registered our Rockly Linux to the Red Hat subscription management service with Simple Content Access enabled. This means that we should be able to download and install packages from the RedHat repositories.
subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Simple Content Access. This host has access to content, regardless of subscription status.
System Purpose Status: Disabled
Generate RHEL Pre-conversion Analysis Report
convert2rhel analyze
is a command that can be used to check the eligibility of a system for conversion to Red Hat Enterprise Linux (RHEL). It performs a pre-conversion analysis to ensure that the system is compatible with RHEL and highlights any issues that may prevent a successful conversion.
convert2rhel analyze
When you run the command, the possible output is:
- Info: No impact, just informational.
- Success: No issues found, ready for conversion.
- Error: Critical issue that must be fixed before conversion.
- Overridable: Issue that can be overridden but should be fixed to avoid problems.
- Warning: Non-critical issue that may cause issues post-conversion.
- Skip: Test skipped due to a prerequisite failure, may affect conversion.
If you are using local RedHat repos, you can specify the repo ID as well as no RHSM;
convert2rhel analyze --enablerepo rhel8.10 --no-rhsm --els
This is a snippet of our conversion analysis;
========== Success (No changes needed) ==========
(SUCCESS) CHECK_FIREWALLD_AVAILABILITY::SUCCESS - N/A
(SUCCESS) CONVERT2RHEL_LATEST_VERSION::SUCCESS - N/A
(SUCCESS) DBUS_IS_RUNNING::SUCCESS - N/A
(SUCCESS) DUPLICATE_PACKAGES::SUCCESS - N/A
(SUCCESS) EFI::SUCCESS - N/A
(SUCCESS) ELS_SYSTEM_CHECK::SUCCESS - N/A
(SUCCESS) EUS_SYSTEM_CHECK::SUCCESS - N/A
(SUCCESS) GRUB_VALIDITY::SUCCESS - N/A
(SUCCESS) IS_LOADED_KERNEL_LATEST::SUCCESS - N/A
(SUCCESS) PACKAGE_UPDATES::SUCCESS - N/A
(SUCCESS) READ_ONLY_MOUNTS_MNT::SUCCESS - N/A
(SUCCESS) READ_ONLY_MOUNTS_SYS::SUCCESS - N/A
(SUCCESS) RHEL_COMPATIBLE_KERNEL::SUCCESS - N/A
(SUCCESS) TAINTED_KMODS::SUCCESS - N/A
(SUCCESS) BACKUP_REDHAT_RELEASE::SUCCESS - N/A
(SUCCESS) BACKUP_REPOSITORY::SUCCESS - N/A
(SUCCESS) BACKUP_YUM_VARIABLES::SUCCESS - N/A
(SUCCESS) INSTALL_RED_HAT_CERT_FOR_YUM::SUCCESS - N/A
(SUCCESS) INSTALL_RED_HAT_GPG_KEY::SUCCESS - N/A
(SUCCESS) LIST_THIRD_PARTY_PACKAGES::SUCCESS - N/A
(SUCCESS) BACKUP_PACKAGE_FILES::SUCCESS - N/A
(SUCCESS) REMOVE_IWLAX2XX_FIRMWARE::SUCCESS - N/A
(SUCCESS) REMOVE_SPECIAL_PACKAGES::SUCCESS - N/A
(SUCCESS) PRE_SUBSCRIPTION::SUCCESS - N/A
(SUCCESS) SUBSCRIBE_SYSTEM::SUCCESS - N/A
(SUCCESS) CUSTOM_REPOSITORIES_ARE_VALID::SUCCESS - N/A
(SUCCESS) ENSURE_KERNEL_MODULES_COMPATIBILITY::SUCCESS - N/A
(SUCCESS) VALIDATE_PACKAGE_MANAGER_TRANSACTION::SUCCESS - N/A
========== Info (No changes needed) ==========
(INFO) REMOVE_SPECIAL_PACKAGES::SPECIAL_PACKAGES_REMOVED - Special packages to be removed
Description: We have identified installed packages that match a pre-defined list of packages that are to be removed during the conversion
Diagnosis: The following packages will be removed during the conversion: rocky-gpg-keys-8.10-1.9.el8.noarch, rocky-release-8.10-1.9.el8.noarch, rocky-repos-8.10-1.9.el8.noarch
Remediations: N/A
[2025-01-25T11:44:46-0500] DEBUG - /var/run/lock/convert2rhel.pid PID 13631 unlocked.
As you can see, ========== Success (No changes needed) ==========.
Review the report and resolve any issue. Rerun the analyzer again and until you confirm you are ready to go.
Convert Rocky Linux to RHEL using Convert2RHEL Tool
If there is no inhibitors, proceed with migration.
You would run this command if you had RHSM;
convert2rhel
Otherwise, if using custom repos to upgrade, then you need to specify –no-rhsm and the --enablerepo <RHEL_RepoID1> --enablerepo <RHEL_RepoID2>
options.
convert2rhel --enablerepo rhel810 --no-rhsm --els
When prompted on whether to proceed, confirm;
[2025-01-25T12:11:14-0500] TASK - [Prepare: Pre-conversion analysis report] **************************
No problems detected!
WARNING - ********************************************************
WARNING - The tool allows rollback of any action until this point.
WARNING - By continuing all further changes on the system will need to be reverted manually by the user, if necessary.
WARNING - ********************************************************
Continue with the system conversion? [y/n]: y
Here is a snippet of the my Rocky Linux 8.10 to RHEL 8.10 conversion output;
...
========== Success (No changes needed) ==========
(SUCCESS) CONVERT_SYSTEM_PACKAGES::SUCCESS - N/A
(SUCCESS) LOCK_RELEASEVER_IN_RHEL_REPOSITORIES::SUCCESS - N/A
(SUCCESS) CONFIGURE_PKG_MANAGER::SUCCESS - N/A
(SUCCESS) INSTALL_RHEL_KERNEL::SUCCESS - N/A
(SUCCESS) REMOVE_NON_RHEL_KERNELS::SUCCESS - N/A
(SUCCESS) UPDATE_KERNEL::SUCCESS - N/A
(SUCCESS) FIX_INVALID_GRUB2_ENTRIES::SUCCESS - N/A
(SUCCESS) LIST_NON_RED_HAT_PKGS_LEFT::SUCCESS - N/A
(SUCCESS) FIX_DEFAULT_KERNEL::SUCCESS - N/A
(SUCCESS) NEW_DEFAULT_EFI_BIN::SUCCESS - N/A
(SUCCESS) EFIBOOTMGR_UTILITY_INSTALLED::SUCCESS - N/A
(SUCCESS) MOVE_GRUB_FILES::SUCCESS - N/A
(SUCCESS) REMOVE_EFI_CENTOS::SUCCESS - N/A
(SUCCESS) REPLACE_EFI_BOOT_ENTRY::SUCCESS - N/A
(SUCCESS) CONFIGURE_HOST_METERING_IF_NEEDED::SUCCESS - N/A
(SUCCESS) KERNEL_BOOT_FILES::SUCCESS - N/A
(SUCCESS) MODIFIED_RPM_FILES_DIFF::SUCCESS - N/A
(SUCCESS) RHSM_CUSTOM_FACTS_CONFIG::SUCCESS - N/A
(SUCCESS) UPDATE_GRUB::SUCCESS - N/A
(SUCCESS) BREADCRUMBS_FINISH_COLLECTION::SUCCESS - N/A
(SUCCESS) REMOVE_TMP_DIR::SUCCESS - N/A
========== Info (No changes needed) ==========
...
Conversion successful!
WARNING - In order to boot the RHEL kernel, restart of the system is needed.
[2025-01-25T12:18:08-0500] DEBUG - /var/run/lock/convert2rhel.pid PID 15996 unlocked.
Once the conversion is completed, restart your system.
reboot
Verify Rocky Linux to RHEL Migration
As the system boots, you will see that the kernel entry has changed to RHEL.
Once logged in, confirm as well;
hostnamectl
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 1497ff6a4d964a1c9020e479184fe388
Boot ID: dfc18ed4f9ee4a4bbfe493474f9202ad
Virtualization: kvm
Operating System: Red Hat Enterprise Linux 8.10 (Ootpa)
CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos
Kernel: Linux 4.18.0-553.36.1.el8_10.x86_64
Architecture: x86-64
Also;
cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)
Looks good.
If you had any applications running, it is now time to also verify and confirm if they are working as expected.
You can also:
- Register and subscribe your RHEL system if you hadn’t already.
- Remove Convert2RHEL packages and repositories
- Review the list of the third-party packages and remove unnecessary packages from the original OS that remained unchanged (
yum list extras --disablerepo="*" --enablerepo=RHEL_REPO_ID
) - Upgrade RHEL to the latest releases e.g from RHEL 8 to RHEL 9.
Remove Unwanted Kernels
If you check on the GRUB screenshot above, we have transient Rocky Linux kernel entries.
You can list installed kernels;
rpm -qa kernel
kernel-4.18.0-553.36.1.el8_10.x86_64
kernel-4.18.0-477.10.1.el8_8.x86_64
From the command output below, you can see we are running RHEL 8.10 kernel;
uname -r
4.18.0-553.36.1.el8_10.x86_64
Thus, uninstall the old kernel;
dnf remove kernel-4.18.0-477.10.1.el8_8.x86_64
Nexr, update the GRUB entry to remove old kernels.
You can use grubby command to get kernels info:
grubby --info=ALL
index=0
kernel="/boot/vmlinuz-4.18.0-553.36.1.el8_10.x86_64"
args="ro crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap $tuned_params"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-4.18.0-553.36.1.el8_10.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (4.18.0-553.36.1.el8_10.x86_64) 8.10 (Ootpa)"
id="1497ff6a4d964a1c9020e479184fe388-4.18.0-553.36.1.el8_10.x86_64"
index=1
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
args="ro crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap $tuned_params"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-4.18.0-477.10.1.el8_8.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (4.18.0-477.10.1.el8_8.x86_64) 8.10 (Ootpa)"
id="1497ff6a4d964a1c9020e479184fe388-4.18.0-477.10.1.el8_8.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-1497ff6a4d964a1c9020e479184fe388"
args="ro crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap"
root="/dev/mapper/rl-root"
initrd="/boot/initramfs-0-rescue-1497ff6a4d964a1c9020e479184fe388.img"
title="Rocky Linux (0-rescue-1497ff6a4d964a1c9020e479184fe388) 8.8 (Green Obsidian)"
id="1497ff6a4d964a1c9020e479184fe388-0-rescue"
Get the default kernel;
grubby --default-kernel
/boot/vmlinuz-4.18.0-553.36.1.el8_10.x86_64
From the info above, we can remove anything relating to *el8_8*. The full path to transient Rocky Linux 8 kernel from the output above is /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64. To remove this specific kernel, use grubby command as follows;
grubby --remove-kernel /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
You can also remove the associated rescue kernel;
grubby --remove-kernel /boot/vmlinuz-0-rescue-1497ff6a4d964a1c9020e479184fe388
Update GRUB;
grub2-mkconfig -o /boot/grub2/grub.cfg
Reboot the system to verify the changes.
You can also explore other methods of conversion:
And that closes our guide on how to migrated Rocky Linux to RHEL with the Convert2RHEL Tool.
Other RHEL related tutorials