How to Upgrade from RHEL 8 to RHEL 9 Version logo
Linux

How to Upgrade from RHEL 8 to RHEL 9 Version

The objective of this article is to demonstrate how to use the Leapp utility to do an in-place upgrade from Red Hat Enterprise Linux 8 to Red Hat Enterprise Linux 9. RHEL 8 is replaced with RHEL 9 as part of the in-place upgrade.

Introducing RHEL 9, the newest version of RHEL, which Red Hat announced on May 17, 2022, Compared to RHEL 8, Red Hat Enterprise Linux 9 contains significant improvements.

The Red Hat Enterprise Linux 9 release is notable for transitioning to a more transparent development method. The CentOS Stream 9 package base is utilized as the foundation for the distribution, in contrast to the previous release.

Prerequisites:

  • It is not possible to upgrade directly from RHEL 7 to RHEL 9. However, you can upgrade from RHEL 7 to RHEL 8, and finally from RHEL 8 to RHEL 9.
  • Minimum RHEL 8.6 must be running.
  • The SHA1 algorithm has been deprecated in RHEL 9. If you have any packages with RSA/SHA1 signatures, you cannot upgrade If you have these packages, you must remove them. It is no longer allowed in TLS, DTLS, SSH, IKEv2, DNSSEC, Kerberos, and DTLS in the DEFAULT crypto policy, except for HMAC
  • Make sure that your machine has been successfully registered with the Red Hat Content Delivery Network (CDN) or Red Hat Satellite for Subscription.
  • If system is registered with Red Hat Satellite using Red Hat Subscription Manager (RHSM), you must synchronize with RHEL 9 repositories in the Red Hat Satellite server.
  • At least 150MB of free space is required on the boot partition.
  • Save routes (route -n) and IPaddress (ip a) configuration details.
  • Take a snapshot/backup of the machine.
  • If any version lock exists, remove it by running yum versionlock clear.
  • Check SELinux Status and make a note.

How to check rhel version

Red Hat-based distributions have release files in the /etc/redhat-release directory. Use the command to verify Red Hat Enterprise Linux operating system version.

cat /etc/redhat-release

How to upgrade rhel 8 to rhel 9

Updating Red Hat Enterprise Linux operating system, kernel and installed applications is vital to work for System Administrators. Less security problems and more system stability result from an updated Red Hat Enterprise Linux 9 system.

An in-place upgrade to RHEL 9 using the Leapp utility requires the following steps.

Step 1: Upgrade Your System to RHEL 8.6

To perform the in-place upgrade from RHEL 8 to RHEL 9, your machine must run in RHEL 8.6. which is the required source operating system. You can upgrade your older release to RHEL 8.6 by the following command.

dnf update

As soon as you have completed the upgrade, verify that you are running RHEL 8.6 as follows:

cat /etc/redhat-release

Step 2: Check Red Hat Enterprise Linux Server Subscription

A Red Hat Enterprise Linux Server subscription is required to perform this upgrade, run the below command to verify the status.

subscription-manager list --installed

Step 3: Remove “tmp_leapp_py3” Directory.

The following command must be executed if you previously upgraded from RHEL 7 to RHEL 8 in order to remove the tmp_leapp_py3 directory.  you can skip this step if you are installed RHEL 8 from scratch.

rm -rf /root/tmp_leapp_py3

Step 4: Verify RHEL Repositories

As we are upgrading from RHEL 8 to RHEL 9, all essential repositories must be enabled.
You can double-check them by using the below command:

subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms --enable rhel-8-forx86_64-appstream-rpms

Step 5: Lock the System to RHEL 8.6

Now ensure that your RHEL system is locked to RHEL 8.6 since this is the version from which your upgrade will begin.

subscription-manager release --set 8.6

Step 6: Install the Leapp Utility

Pre-upgrade your system with the leapp pre-upgrade command to assess its upgradeability. As part of this phase, the Leapp utility gathers data about your system, determines its upgradeability, and generates a report that describes the upgrade process.
Using the Leapp utility, you can update and upgrade operating systems and applications. Its component packages allow you to create different software upgrade profiles.

dnf install leapp-upgrade -y

The below packages get installed.

  1. leapp-upgrade-el8toel9
  2. leapp
  3. leapp-deps
  4. leapp-upgrade-el8toel9-deps
  5. python3-leapp

Check the downloaded leapp files as shown below.

NOTE: Verify these 3 json files must exist pes-events.json , device_driver_deprecation_data.json ,repomap.json

How to Upgrade from RHEL 8 to RHEL 9 Version

                              Json files for leapp upgrade

if those files are not existing, follow the below steps.

you can download the Leapp utility from the RHEL site manually, under Community Linux distributions will find a Zip file called leapp-data18.tar.gz

Download the leapp-data18.tar.gz file to /etc/leapp/files/ and extract it by using the below command.

tar -xzf leapp-data18.tar.gz -C /etc/leapp/files && rm leapp-data18.tar.gz

Step 7: Remove the Versionlock Plugin

The versionlock plugin locks the packages at a specific version, so you must remove it by following these instructions.

yum versionlock list
yum versionlock clear

Step 8: Disable AllowZoneDrifting

The upgrade will fail due to this problem, and you will receive an error as shown below:

AllowZoneDrifting Error

                                      AllowZoneDrifting Error

To disable AllowZoneDrifting feature, open the firewalld config file by the given command.

vi /etc/firewalld/firewalld.conf

Search for AllowZoneDrifting, and disable it by adding the # at the beginning of that line to avoid the error.

#AllowZoneDrifting=yes

#AllowZoneDrifting=yes

Save the file and restart the firewalld service for the changes to apply run the below command.

systemctl restart firewalld

Step 9: Perform the Pre-upgrade Phase.

The best way to determine if there are any issues related to packages for the upcoming upgrade session is to check this run below command.

leapp preupgrade --target 9.0

As long as everything goes perfect, a summary with the package sizes and a report will be generated in a text format at /var/log/leapp/leapp-report.txt. Depending on the results, the upgrade will either not run or be suspended until the issues are resolved.

Step 10: Upgrading from RHEL 8 to RHEL 9

It is now time to download and install new packages using Leapp utility, which is already installed in the machine. Lastly, run the in-place upgrade command to upgrade to RHEL 9.

leapp upgrade --target 9.0

Reboot your system after the new packages have been downloaded and installed. once the reboot is done, on the GRUB menu select the RHEL-Upgrade-Initramfs option to access RHEL 9.

How to Upgrade from RHEL 8 to RHEL 9 Version

                                   Choose RHEL-Upgrade-initramfs

 

As soon as RHEL 9 has been selected, some packages will be upgraded, and others will be decommissioned.

The system requires one more reboot, and that time select the first option GRUB entry as mentioned below.

Red Hat Enterprise Linux (5.14.0-70.17.1. e19_0.x86_64) 9.0 (Plow)

Currently, the system is locked to version 8.6, so you must update it to version 9.0 by running the following command.

subscription-manager release --set=9.0
subscription-manager release --show

you can confirm the current version of RHEL by running the following command.

cat /etc/redhat-release

Conclusion:

Completed successful in-place upgrade from Red Hat Enterprise Linux 8 to Red Hat Enterprise Linux 9. Best wishes as you begin using your RHEL 9. This article explains how to Upgrade from RHEL 8 to RHEL 9 Version. Please feel free to contact me if you need any further information about the upgradation.

Next PostIntroduction to VMware NSX-T and Its Components Previous PostADDC Domain Could Not be Contacted

Leave a Reply

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