This article will show you how to upgrade RHEL 7 to RHEL 8
Use case
I have a Dell server recently upgraded with H700 raid controller, the OS used to be RHEL7, now it’s qualified to be upgraded to RHEL 8.
Preparation for upgrade
Check subscriptions status, run below command to check your RHEL subscription status
subscription-manager status
# Example output
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Current
System Purpose Status: Not Specified
If you have below output indicates that your system is not subscribed.
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Invalid
Red Hat Enterprise Linux for x86_64:
- Not supported by a valid subscription.
You can try to run below command to attach a subscription or follow this article
sudo subscription-manager remove --all
sudo subscription-manager unregister
sudo subscription-manager clean
sudo subscription-manager register
sudo subscription-manager refresh
sudo subscription-manager attach --auto
Once done, you should have below example outputs
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status: Subscribed
Run below command to check installed products
subscription-manager list --installed
# Example output
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID: 69
Version: 7.9
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 26/09/22
Ends: 26/09/23
Ensure you have appropriate repositories enabled.
Run below commands to ensure required repos are enabled.
sudo subscription-manager repos --enable rhel-7-server-rpms
sudo subscription-manager repos --enable rhel-7-server-extras-rpms
Run below command to use RHEL 7 latest content
sudo subscription-manager release --unset
Run below command to apply latest updates from RHEL7 then reboot your system.
sudo yum update
Once your system is up after reboot, run below command
sudo yum install leapp-upgrade
Upgrade RHEL7 with leapp utility
Run below command to start upgrade, I did not pass a target option , will use default target documented here
sudo leapp upgrade
Got some error printed out as below, now I’m going to fix them one by one.
Upgrade has been inhibited due to the following problems:
1. Inhibitor: Cannot upgrade a system with FIPS mode enabled
2. Inhibitor: Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
3. Inhibitor: Upgrade requires links in root directory to be relative
4. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.
Inhibitor 1: Follow below link to update your system
https://access.redhat.com/solutions/2422061
# 1. Remove the dracut-fips* packages
yum remove dracut-fips\*
# 2. Backup existing FIPS initramfs
mv -v /boot/initramfs-$(uname -r).img{,.FIPS-bak}
# 3. Run dracut to rebuild the initramfs
dracut
# 4. Remove the fips=1 argument from the kernel command-line
grubby --update-kernel=ALL --remove-args=fips=1
[[ -f /etc/default/grub ]] && sed -i 's/ fips=1//' /etc/default/grub
# 5. Reboot
reboot
# 6. Confirm that FIPS is not in enforcing mode after a reboot
sysctl crypto.fips_enabled
Inhibitor 2: Follow below link to update your system, check your leapp report, remove unsupported packges
https://access.redhat.com/solutions/6971716
Inhibitor 3: Follow below link to update your system.
https://access.redhat.com/solutions/6989732
Inhibitor 4, Make change as below
[remove_pam_pkcs11_module_check]
# Title: None
# Reason: Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label: Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted.
# Description: PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD.
# Reason: Leaving this module in PAM configuration may lock out the system.
# Type: bool
# Default: None
# Available choices: True/False
confirm = True
After reboot your system, run `sudo leapp upgrade` again
I experienced this error and found below article on how to fix it
Error: “DNF execution failed with non zero exit code”
https://access.redhat.com/solutions/6971719
https://access.redhat.com/discussions/6259931