In this post I wanted to demonstrate converting from one of the RHEL compatible Enterprise Linux distributions, like CentOS, Rocky Linux or Oracle Linux, to Red Hat Enterprise Linux. I’ll be demonstrating from an Oracle Linux server running in Proxmox, however these steps will work regardless of the RHEL compatible distribution you are starting from as long as it’s one of the supported systems.
You must be running one of the RHEL compatible distributions already. The conversion does not work from other Linux distributions, such as Debian or Ubuntu, and it also does not work if you’re starting from CentOS Stream.
There are really 2 main prequisites that you’ll need before attempting this conversion.
- You are already running a RHEL compatible distribution of at least version 7+. If you have an older distribution you’ll need to upgrade first.
- You have a valid RHEL subscription. I’ll be using the Free developer subscription that entitles you to run up to 16 Red Hat Enterprise Linux installations, as well as access to other Red Hat products.
If you need to upgrade from an older version of RHEL or CentOS, you should check out the leapp upgrade tool.
DISCLAIMER: Now before we start, I am running this in my homelab environment, not a production environment. I’m doing this as a trial run before I do an actual OUL to RHEL conversion in production for myself. This is for my own experience and practice, and I advise you to practice the conversion in test environments before running on production servers too. I’m not responsible for any damage done to your own servers. If you run into any issues and you have an active RHEL subscription you should contact Red Hat for support.
I have a running Oracle Linux 8 system that I’ll be using to convert to RHEL 8.
I’ve also set this server up to host a simple WordPress website with Apache, PHP 8, and MariaDB.
The first step in converting to RHEL is to download the convert2rhel tool. I’ve downloaded the tool from github and installed it on the OUL machine. If you’re converting from CentOS and can connect your system to Red Hat Satellite or console.redhat.com, you will be able to enable the Convert2RHEL repos and manage the conversion from there.
$ wget https://github.com/oamg/convert2rhel/releases/download/v2.1.0/convert2rhel-2.1.0-1.el8.noarch.rpm
$ dnf localinstall ./convert2rhel-2.1.0-1.el8.noarch.rpm
Once it’s installed, run the convert2rhel analyze to determine if the system can be converted.
$ convert2rhel analyze
After a minute or so, the analyze tool spat out a whole bunch of red error messages, but this is the point of analyzing first. My issues were with the firewalld service running, and the default Oracle Linux kernel that needed to be fixed. Oracle Linux generally installs the Unbreakable Enterprise Kernel which is incompatible with the Red Hat kernel, so I’ll need to fix both of those before continuing.
I’ll fix the kernel issue first.
$ grubby --default-kernel
/boot/vmlinuz-5.15.0-209.161.7.2.el8uek.x86_64
$ grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-5.15.0-209.161.7.2.el8uek.x86_64"
kernel="/boot/vmlinuz-4.18.0-553.16.1.el8_10.x86_64"
kernel="/boot/vmlinuz-0-rescue-83229607f01f471dbd78c219e5e4fc07"
The default kernel on the system is the UEK kernel, but there’s a Red Hat kernel already installed, so I’ll set that one as default and reboot.
$ grubby --set-default /boot/vmlinuz-4.18.0-553.16.1.el8_10.x86_64
$ grubby --default-kernel
/boot/vmlinuz-4.18.0-553.16.1.el8_10.x86_64
Once the machine has rebooted, I’ll re-run the analyze command.
The kernel error message has been resolved, so now it’s Firewalld error. There’s also an error message about the system not being connected to a Red Hat subscription, which is fine, we’ll fix that shortly.
I’m just going to run the suggested commands to remove the Firewalld error.
$ sed -i -- 's/^CleanupModulesOnExit.*/CleanupModulesOnExit=no/g' /etc/firewalld/firewalld.conf
$ firewall-cmd --reload
In the convert2rhel man page there’s a few options for authenticating to the subscription manager, including passing your username and password, or activation key at the command line. But the option I’m going to use is the -c option for using a config file. The convert2rhel tool has installed a config file at /etc/convert2rhel.ini which you can override.
$ cp /etc/convert2rhel.ini ~
[subscription_manager]
username = <insert_username>
password = <insert_password>
I’ve copied the ini file to my root user home directory and I’ll update it with my RHSM subscription details.
I’ll re-run the analyze tool, hopefully one last time, to check the subscription and then we should be good to go.
$ convert2rhel analyze -c /root/convert2rhel.ini
Everything looked good. There was a warning about third-party tools being installed because it detected the convert2rhel tool that I installed that wasn’t from a supported repository which I’m going to ignore. Otherwise, let’s do this.
$ convert2rhel -c /root/convert2rhel.ini
The conversion took a few minutes. But by the end it completed successfully, so I’ll reboot the machine.
The system rebooted into Red Hat Enterprise Linux and everything looks great.
I checked the system was registered correctly and changed the hostname because I previously had it set to oracle-linux.localnet.com.
$ 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
This is a test machine, so the subscription status is fine. Installed the insights-client and registered.
$ dnf install insights-client
$ insights-client --register
Lastly, I’ll check that the WordPress installation is still working.
I noticed the hostname of the httpd configuration was still the previous oracle-linux hostname, so I’ll change that.
Everything looks great. The conversion from Oracle Linux to Red Hat Enterprise Linux was successful.