How To Upgrade From RHEL 7 to RHEL 8
Red Hat Enterprise Linux 8 has been released on May 7th, 2019. This new release comes with lots of new features and an option to upgrade from RHEL 7 to RHEL 8.
In my previous post, I explained the Step by Step installation RHEL 8, and it was a clean installation of OS. As I said earlier, it is now possible to upgrade from Red Hat Enterprise Linux 7 to Red Hat Enterprise Linux 8 with the help of Leapp utility.
In this post, we will see how to upgrade from RHEL 7 to RHEL 8.
- RHEL 7.6 x86_64 System
- Server Variant
- At least 100MB free space on /boot partition
Make sure you run a full system backup with the backup tool that your organization is using or take a virtual machine snapshot if the server is a virtual machine.
This task is a very important pre-upgrade activity which helps you get a system back to what it was before the upgrade in case of any problem post upgrade to RHEL 8.
Make sure you have enabled RHEL subscription on your system by registering it with Red Hat. If not, use the below command to register the system.
Assign a Red Hat Enterprise Linux server subscription to the system using the below command. This command will assign subscription automatically based on the operating system.
subscription-manager attach --auto
Verify the attached subscription with the below command.
subscription-manager list --installed
Prepare System for Upgrade
If you see the above output, my system is RHEL 7.5, and it needs to update to RHEL 7.6. So, to avoid the server being upgraded to a later version (Ex. RHEL 7.7 in future), we will set RHEL 7.6 as a starting point for the upgrade.
subscription-manager release --set 7.6
If you use yum versionlock (It restricts yum to install or upgrade a package to upgrade to a specific version not to a later version), clear the lock by running:
yum versionlock clear
Since I don’t use yum versionlock, I got an error while running the above command.
Update all packages to the latest version.
yum -y update
Loaded plugins: product-id, search-disabled-repos, subscription-manager rhel-7-server-rpms | 3.5 kB 00:00:00 (1/3): rhel-7-server-rpms/x86_64/updateinfo | 3.1 MB 00:00:02 (2/3): rhel-7-server-rpms/x86_64/group | 774 kB 00:00:01 (3/3): rhel-7-server-rpms/x86_64/primary_db | 55 MB 00:00:12 Resolving Dependencies --> Running transaction check ---> Package GeoIP.x86_64 0:1.5.0-11.el7 will be updated ---> Package GeoIP.x86_64 0:1.5.0-13.el7 will be an update ---> Package NetworkManager.x86_64 1:1.10.2-13.el7 will be updated . . . . . . python-backports x86_64 1.0-8.el7 rhel-7-server-rpms 5.8 k python-backports-ssl_match_hostname noarch 184.108.40.206-1.el7 rhel-7-server-rpms 13 k python-ipaddress noarch 1.0.16-2.el7 rhel-7-server-rpms 34 k python-setuptools noarch 0.9.8-7.el7 rhel-7-server-rpms 397 k Transaction Summary ===================================================================================== Install 1 Package (+7 Dependent packages) Upgrade 179 Packages Total download size: 249 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. warning: /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/GeoIP-1.5.0-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Public key for GeoIP-1.5.0-13.el7.x86_64.rpm is not installed (1/187): GeoIP-1.5.0-13.el7.x86_64.rpm | 1.5 MB 00:00:02 (2/187): NetworkManager-config-server-1.12.0-10.el7_6.noarch. | 146 kB 00:00:00 (3/187): NetworkManager-1.12.0-10.el7_6.x86_64.rpm | 1.7 MB 00:00:03 . . . . . . vim-minimal.x86_64 2:7.4.160-5.el7 wpa_supplicant.x86_64 1:2.6-12.el7 xfsprogs.x86_64 0:4.5.0-19.el7_6 yum.noarch 0:3.4.3-161.el7 zlib.x86_64 0:1.2.7-18.el7 Complete!
Reboot the system to complete system updates.
Ensure the system version is now RHEL 7.6 in case you had some other version before the update.
Enable the RHEL 7 Server – Extras (RPMs) repository using the below command.
subscription-manager repos --enable rhel-7-server-extras-rpms
Install the Leapp utility using the yum command.
yum install -y leapp
Install the wget package to download additional files required for upgradation using the terminal.
yum install -y wget
Download additional required data files from the knowledgebase article and place them in /etc/leapp/files/ directory.
cd /etc/leapp/files/ wget https://access.redhat.com/sites/default/files/attachments/leapp-data4.tar.gz
Extract the archive file you downloaded from knowledgebase using the tar command.
tar -zxvf leapp-data4.tar.gz
Delete the archive file after extracting its content.
rm -rf leapp-data4.tar.gz
Upgrade from RHEL 7 to RHEL 8
Begin the system upgrade with below command.
The Leapp utility now starts collecting system data, checks for system upgradability, and creates a pre-upgrade report in /var/log/leapp/leapp-report.txt file.
If the system is upgradable, Leapp utility downloads the data and rpms for the upgrade. In case of any issues, Leapp stops the upgrade process and create a detailed report about issues and recommended solutions in the /var/log/leapp/leapp-report.txt file.
Once the system upgrade is complete, reboot the system.
Upon reboot, the system will boot into RHEL 8 based initial RAM disk image, initramfs.
Leapp upgrades all packages and automatically reboot to the RHEL 8 system.
Login to the RHEL 8 system.
Set SELinux mode to Enforcing.
Make it permanent with below command.
sed -i 's/SELINUX=permissive/SELINUX=enforcing/g' /etc/selinux/config
Enable the Firewall
systemctl start firewalld systemctl enable firewalld
Verify RHEL 8 Upgrade
Verify the current OS version with the below command. The current version should be Red Hat Enterprise Linux 8.
Check the Kernel version. It should be v4.18 with .el8.
Verify that Red Hat Enterprise 8 is installed.
subscription-manager list --installed
Finally, check if you can access the RHEL 8 system over SSH. This step ensures that network services are functioning correctly.
If you see my previous screenshot, I have loggedin into the RHEL 8 system using PUTTY which confirms that the RHEL 8 system is available in the network.