How To Convert CentOS 7 Linux To RHEL 8 Server
How To Convert CentOS 7 Linux To RHEL 8 Server
com/how-to-convert-centos-7-linux-to-rhel-8-server/
Hello everyone and welcome to today’s guide on how to migrate CentOS 7 Linux to
RHEL 8 Server. CentOS 7 will reach its EOL on 30th June 2024, necessitating
converting to a stable and secure RHEL 8. CentOS is the community version of RHEL.
RHEL 8 is a more stable and secure OS that allows developers to use the latest tools and
packages available in the market for managing their OS. CentOS Linux 8 reached its
end of life on 31st December 2021 and its users will be required to migrate to CentOS
Stream 8. Conversion from CentOS Stream to RHEL is not currently supported.
This, therefore, calls for migration from CentOS 7 to RHEL to continue enjoying the
support from the community and also get to enjoy the use of the latest tools and package
updates. With RHEL, you are able to address any issues or bugs for better experience
and productivity.
For you to follow through with the guide, I assume you already have your CentOS 7
Linux machine which you intend to migrate to RHEL 8, and a superuser account. Let’s
now fold our sleeves and get started.
Pre-requisites
From the official RedHat website, It is possible to convert from CentOS Linux 7 to Red
Hat Enterprise Linux 7. In this article, we will convert from CentOS Linux 7 to Red Hat
Enterprise Linux 7 and then from Red Hat Enterprise Linux 7 to Red Hat Enterprise
Linux 8.
Update your system to refresh Yum packages prior to beginning the conversion process.
$ uname -r
3.10.0-1160.45.1.el7.x86_64
$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
sudo reboot
Step 2 : Install Convert2RHEL Utility
Once the packages are refreshed and the YUM index updated, install the
Convert2RHEL utility tool.
Sample output:
Installed:
convert2rhel.noarch 0:0.25-1.el7
Dependency Installed:
pexpect.noarch 0:2.3-11.el7
Complete!
For conversion to be successful, you must have the latest version of the Convert2rhel
Utility installed in the system.
Red Hat Satellite server
If RHEL packages are accessed through the Red Hat Satellite server, you need to
download the RPM packages to the /usr/share/convert2rhel/subscription-manager/
directory and download the katello-ca-consumer-latest package from the Satellite
server.
Replace the Satellite’s server’s hostname i.e satellite.example.com with your Satellite
server’s hostname.
Step 3 : Convert CentOS 7 to RHEL 7
In this step, we will convert CentOS7 to RHEL7 before migrating to RHEL8. This is
because RHEL8 requires dnf-utils which are not supported by CentOS7 and hence cant
be installed in CentOS 7.
There are two methods of registering and subscribing to your system during the
conversion.
1 ) Provide the organization ID and activation key. This method is preferred when
multiple systems are to be converted. This method must be used when accessing RHEL
packages using Satellite through RHSM (Red Hat Subscription Manager).
2 ) Provide the username, password, and pool ID. Users accessing RHEL packages
using Red Hat CDN through RHSM can use this method.
Replace the organization_ID and activation_key with the organization ID and activation
key from the Red Hat Customer Portal if you are using Red Hat CDN or the Satellite
web UI if you are using Red Hat Satellite.
If you are accessing RHEL packages using Satellite, you must use the organization ID
and activation key to run the convert2rhel command.
If you are accessing RHEL packages using Satellite and your system has no internet
access, add the --keep-rhsm option. You must have the subscription-
manager and katello-ca-consumer packages already installed and must provide your
organization ID and activation key when running the convert2rhel command.
For example:
Replace username and password with your Red Hat Account credentials. See the below
example:
Where:
pool_ID is replaced with the pool ID of the subscription that you want to attach
to the system. If you are not sure about the pool_ID omit the –pool option.
In this article, I will use the second option where I will provide the username and the
password. I will use my RedHat username. I will skip the password bit intentionally to
provide it later during the conversion process.
Sample output:
Conversion-Initialization-process
The backup will be done automatically as below:
system-backup-prior-to-conversion
As the process progresses, you will be prompted to read the license agreement as well
as agree to several prompts by answering with a y.
Process-prompts-you-to-continue-with-conversion
Once you agree, the backup will be done and unwanted packages removed while
installing the RHEL packages necessary for conversion.
The next prompt will be to supply the RHEL password for the user.
Enter-RHEL-password-for-the-user
Once you supply the correct password, registering the system using the subscription
manager will be initiated. The process will continue and the next prompt is to Enter the
number of the chosen subscription. I will choose Subscription number 2 which is Red
Hat Developer Subscription for Individuals and provides Red Hat Developer Tools (for
RHEL Server for ARM) among others.
It’s good to note that every Subscription number has its own pool ID. Enter 2 as your
chosen subscription and press Enter.
choose-subscription-number
The next prompt will be to Continue with the system conversion. Say y and press
Enter.
Continue-with-conversion-prompt
More prompts to continue with conversion: Agree to the prompt by y and press Enter.
continue-with-system-conversion
The process of conversion will take some time depending on the speed of your internet,
your CPU, and your memory resources.
Transaction Summary
======================================================================
==========
Install 1 Package (+3 Dependent packages)
Reinstall 1317 Packages
Not available 53 Packages
conversion-successful
Once the process of conversion is complete, you need to ascertain that conversion was
actually successful.
Confirm that your system is running on RedHat Enterprise Linux 7 by this command.
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
$ uname -r
3.10.0-1160.49.1.el7.x86_64
Conversion to RHEL 7 was successful. In the following steps, we will convert RHEL 7
to RHEL 8.
Step 5 : Upgrading from RHEL 7 to RHEL 8.
This article assumes you already have RHEL 7 running in your system or have
converted your system to RHEL by following the steps above.
1 ) Verify that you have Red Hat Enterprise Linux Server Subscription attached.
The output:
Installed:
leapp-upgrade-el7toel8.noarch 0:0.15.0-6.el7_9
Dependency Installed:
dnf.noarch 0:4.0.9.2-2.el7_9
dnf-data.noarch 0:4.0.9.2-2.el7_9
leapp.noarch 0:0.13.0-1.el7_9
leapp-deps.noarch 0:0.13.0-1.el7_9
leapp-upgrade-el7toel8-deps.noarch 0:0.15.0-6.el7_9
libcomps.x86_64 0:0.1.8-14.el7
libdnf.x86_64 0:0.22.5-2.el7_9
libmodulemd.x86_64 0:1.6.3-1.el7
librepo.x86_64 0:1.8.1-8.el7_9
librhsm.x86_64 0:0.0.3-3.el7_9
libsolv.x86_64 0:0.6.34-4.el7
python2-dnf.noarch 0:4.0.9.2-2.el7_9
python2-hawkey.x86_64 0:0.22.5-2.el7_9
python2-leapp.noarch 0:0.13.0-1.el7_9
python2-libcomps.x86_64 0:0.1.8-14.el7
python2-libdnf.x86_64 0:0.22.5-2.el7_9
Complete!
Leapp and its dependencies are successfully installed. Ensure the latest version of Leapp
is installed for successful conversion.
The output:
Leapp-pre-upgrade-report
The pre-upgrade report is available both on the web console (.json file) or as text (.txt)
in the /var/log/leapp/leapp-report.json and /var/log/leapp/leapp-
report.txt respectively.
Analyze the report before proceeding. See more information about these two methods
here
uncomment-the-confirm-section
All you need to do is uncomment the confirm line of the file by deleting the # symbol,
and confirm your answer as True.
2 ) . You can achieve the same outcome by running the command below:
Another inhibitor : Upgrade has been inhibited due to the following problems:
Possible problems with remote login using root account . To solve this problem ,
Enable PermitRootLogin into the /etc/ssh/sshd_config file. This is done by deleting
the # symbol as shown below.
Permit-Root-Login
Then start the service:
Then finally i had to set the SELinux to permissive from enforcing by editing the
selinux config file.
Its also important i mention that you need to download Leapp utility metadata in-place
upgrades of RHEL for disconnected upgrades. The latest metadata file from the official
redhat site is leapp-data15 . All you need to do is manually download the file into
/etc/leapp/files/ and extract it. This file is available here. You will see the file towards
the end of the article. When all is set , run the leapp preupgrade command.
If you get this output, you are ready for the upgrade.
Ready-For-Upgrade
On your RHEL 7 system, start the upgrade process by running this command
The process of upgrade takes time as thousands of packages are installed. please be
patient and give it some time. You will be required to reboot your system during the
upgrade process.
Once you reboot, The upgrade process will continue. See a snapshot of the process
below.
upgrade-snapshot
At this point ,i recommend you take a book and read as this process will take long
depending on internet resources and speed.
Once the process completes, the system boots as shown in the screenshot. Notice the
kernel version has changed to 4.18
Kernel-version-4.18.0
From the output we can deduce that we are on RHEL 8.4 0otpa. The system boots like
this .
RHEL-8-interface
Step 8 : Post installations tweaks
Lets confirm what our Redhat release is .
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
$ uname -r
4.18.0-305.25.1.el8_4.x86_64
$ subscription-manager release
Release: 8.4
Change Hostname
$ hostname -f
rhel-8
A ) Remove any remaining Leapp packages from exclude list in the /etc/dnf/dnf.conf
configuration file.
cockpit-leapp-0.1.6-2.el7_9.noarch
flite-1.3-22.el7.x86_64
kernel-3.10.0-1160.59.1.el7.x86_64
kernel-3.10.0-1160.el7.x86_64
leapp-0.13.0-1.el7_9.noarch
leapp-upgrade-el7toel8-0.15.0-6.el7_9.noarch
libchamplain-0.12.16-2.el7.x86_64
libchamplain-gtk-0.12.16-2.el7.x86_64
libIDL-0.8.14-8.el7.x86_64
python2-leapp-0.13.0-1.el7_9.noarch
ustr-1.0.4-16.el7.x86_64
# Example
sudo [ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-
kernel 3.10.0-1160.59.1.el7.x86_64 3.10.0-1160.el7.x86_64
Conclusion
Congratulations , your system has successfully been converted from CentOS 7 Linux
Machine To RHEL 8 Server. I hope you have learnt something new. The article is quite
lengthy but worth it. Please carry out the steps keenly and seek to understand every step.
If you love what we do, please buy us a coffee. It makes us stay awake at night as we do
our research. Please leave a comment below and dont hesitate to ask any question.
See more resourceful: