More

    Upgrade from RHEL 7 to RHEL 8

    Upgrade from RHEL 7 to RHEL 8 Using Leapp Utility

    This guide is all about taking you through the step by step process of performing in-place upgrade from RHEL 7 to RHEL 8 using the Leapp utility.

    RHEL7 maintenance support phase will come to an end in June 2024 hence the need to upgrade to the next available major release – RHEL 8.

    Check the current RHEL version using the following command:

    # cat /etc/os-release
    
    NAME="Red Hat Enterprise Linux Server"
    VERSION="7.9 (Maipo)"
    ID="rhel"
    ID_LIKE="fedora"
    VARIANT="Server"
    VARIANT_ID="server"
    VERSION_ID="7.9"
    PRETTY_NAME="Red Hat Enterprise Linux"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
    HOME_URL="https://www.redhat.com/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    
    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
    REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
    

    Ensure you have a valid RHEL subscription. You can register and subscribe through subscription manager:

    subscription-manager register --username xxxx --password xxxxx

     

    Enable repos

    Ensure that you have enabled the required repositories required for the upgrade. We need the Base repository(rhel-7-server-rpms) and the Extras repository(rhel-7-server-extras-rpms) where leapp and its dependencies are derived from.

    subscription-manager repos --enable rhel-7-server-rpms --enable rhel-7-server-extras-rpms

     

    Expected output:

    Repository 'rhel-7-server-rpms' is enabled for this system.
    Repository 'rhel-7-server-extras-rpms' is enabled for this system.
    

     

    Verify the repos

    We need to verify that all expected RHEL 7 repositories are enabled in the server that we are upgrading through the command below:

    subscription-manager repos --list-enabled | grep "^Repo ID"

    Expected Output:

    Repo ID:   rhel-7-server-extras-rpms
    Repo ID:   rhel-7-server-rpm

    Update All Packages

    Ensure that all packages have been updated to the latest version on your RHEL 7 instance. You can use yum utility to do it.

    yum update -y

    Reboot

    Reboot the RHEL 7 instance to ensure that you’re running the latest kernel.

    reboot

     

    Install leapp

    Use yum to install the Leapp utility.

    yum install leapp

    Expected Output:

    Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
    rhel-7-server-extras-rpms                                                                                                                                                                      | 3.4 kB  00:00:00     
    rhel-7-server-rpms                                                                                                                                                                             | 3.5 kB  00:00:00     
    (1/2): rhel-7-server-extras-rpms/x86_64/updateinfo                                                                                                                                             | 258 kB  00:00:01     
    (2/2): rhel-7-server-extras-rpms/x86_64/primary_db                                                                                                                                             | 710 kB  00:00:01     
    ...
    
    Installed:
      leapp.noarch 0:0.15.1-1.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-deps.noarch 0:0.15.1-1.el7_9             leapp-upgrade-el7toel8.noarch 0:0.18.0-3.el7_9         
      leapp-upgrade-el7toel8-deps.noarch 0:0.18.0-3.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                  python-enum34.noarch 0:1.0.4-1.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.15.1-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!
    
    

     

     

    Note:

    Leapp data files are now a part of the leapp-repository package. Therefore, you no longer need to manually download these files.

    Optionally, the leap files can be downloaded from here. You need login credentilas to be able to download as only Subscribers can view this attachment.

     

    Leapp Pre-upgrade

    We use leapp preupgrade command to assess the upgradability of the system. The Leapp utility collects data about the system and generates a pre-upgrade report. This report provides a summary of potential problems and suggests recommended solutions to these problems.

     leapp preupgrade --target 8.9

    Analyze the report at the end. It’s key that you review the pre-upgrade report in the generated /var/log/leapp/leapp-report.txt and manually resolve reported inhibitors using the command-line interface(CLI). As an alternative, you can answer the true or false question by running the following command:

    leapp answer --section <question_section>.<field_name>=<answer>

    Fix Inhibitor Examples

    leapp answer --section remove_pam_pkcs11_module_check.confirm=True;
    leapp answer --section authselect_check.confirm=True;
    rmmod pata_acpi floppy;
    
    

     

    Inhibitors prevent you from upgrading until you have resolved them. The report contains the following risk factor levels:

    • High   : Very likely to result in a deteriorated system state.
    • Medium : Can impact both the system and applications.
    • Low    : Should not impact the system but can have an impact on applications.
    • Info   : Informational with no expected impact to the system or applications.
    ==> Processing phase Reports
    ====> * verify_check_results
            Check all dialogs and notify that user needs to make some choices.
    ====> * verify_check_results
            Check all generated results messages and notify user about them.
    
    ============================================================
                         UPGRADE INHIBITED                      
    ============================================================
    
    Upgrade has been inhibited due to the following problems:
        1. Inhibitor: Multiple devel kernels installed
        2. Inhibitor: Missing required answers in the answer file
        3. Inhibitor: Missing required answers in the answer file
    Consult the pre-upgrade report for details and possible remediation.
    
    ============================================================
                         UPGRADE INHIBITED                      
    ============================================================
    
    
    Debug output written to /var/log/leapp/leapp-preupgrade.log
    
    ============================================================
                               REPORT                           
    ============================================================
    
    A report has been generated at /var/log/leapp/leapp-report.json
    A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                           END OF REPORT                        
    ============================================================
    
    Answerfile has been generated at /var/log/leapp/answerfile
    

     

    Review the Inhibitors and High’s from the report – /var/log/leapp/leapp-report.txt

    # cat /var/log/leapp/leapp-report.txt
    Risk Factor: high (inhibitor)
    Title: Multiple devel kernels installed
    Summary: DNF cannot produce a valid upgrade transaction when multiple kernel-devel packages are installed.
    Remediation: [hint] Remove all but one kernel-devel packages before running Leapp again.
    [command] yum -y remove kernel-devel-3.10.0-1160.99.1.el7
    Key: 8ceea81afbbb1a329b7d82ca7212b21509e5b256
    ----------------------------------------
    Risk Factor: high (inhibitor)
    Title: Missing required answers in the answer file
    Summary: One or more sections in answerfile are missing user choices: remove_pam_pkcs11_module_check.confirm
    For more information consult https://leapp.readthedocs.io/en/latest/dialogs.html
    Remediation: [hint] Please register user choices with leapp answer cli command or by manually editing the answerfile.
    [command] leapp answer --section remove_pam_pkcs11_module_check.confirm=True
    Key: d35f6c6b1b1fa6924ef442e3670d90fa92f0d54b
    ----------------------------------------
    Risk Factor: high (inhibitor)
    Title: Missing required answers in the answer file
    Summary: One or more sections in answerfile are missing user choices: authselect_check.confirm
    For more information consult https://leapp.readthedocs.io/en/latest/dialogs.html
    Remediation: [hint] Please register user choices with leapp answer cli command or by manually editing the answerfile.
    [command] leapp answer --section authselect_check.confirm=True
    Key: 68c3ee4354bd3c4e56697a9c34a9be5ce450ecf8
    ----------------------------------------
    
    .....

     

    Fix Leapp Pre-upgrade Inhibitors

    Remove kernel-devel packages

    As recommended by the Leapp report, we need to remove all kernel-devel packages before running leapp preupgrade again.

    yum -y remove kernel-devel-3.10.0-1160.*

     

    Expected Output:

    Removing:
     kernel-devel                                     x86_64                                     3.10.0-1160.99.1.el7                                       @rhel-7-server-rpms                                      38 M
    
    Transaction Summary
    ======================================================================================================================================================================================================================
    Remove  1 Package
    
    Installed size: 38 M
    Downloading packages:
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Erasing    : kernel-devel-3.10.0-1160.99.1.el7.x86_64                                                                                                                                                           1/1 
      Verifying  : kernel-devel-3.10.0-1160.99.1.el7.x86_64                                                                                                                                                           1/1 
    
    Removed:
      kernel-devel.x86_64 0:3.10.0-1160.99.1.el7                                                                                                                                                                          
    
    Complete!
    

     

    Remove kernel modules/drivers that have been removed in RHEL 8

    Inhibitor: Detected loaded kernel drivers (pata_acpi & floppy) which have been removed in RHEL 8.
    Solution: rmmod pata_acpi – Support for this device driver has been removed in RHEL 8.

     rmmod pata_acpi floppy
    

    Fix PAM Modules

    Inhibitor: Missing required answers in the answer file.
    Solution: Execute the command given under command section, in my case:

    leapp answer --section remove_pam_pkcs11_module_check.confirm=True
    leapp answer --section authselect_check.confirm=True

     

    After fixing the inhibitors, run the leapp preupgrade command again and validate that you get a clean report before doing the actual leapp upgrade as shown below:

    Transaction Summary
    =============================================================================================================================================================
    Install     523 Packages
    Upgrade    1283 Packages
    Remove      243 Packages
    Downgrade    21 Packages
    
    Total size: 1.7 G
    Total download size: 1.6 G
    Downloading Packages:
    Check completed.
    ====> * check_systemd_services_tasks
            Inhibit the upgrade if SystemdServicesTasks tasks are in conflict
    ====> * report_set_target_release
            Reports information related to the release set in the subscription-manager after the upgrade.
    ====> * check_initramfs_tasks
            Inhibit the upgrade if conflicting "initramfs" tasks are detected
    ==> Processing phase Reports
    ====> * verify_check_results
            Check all dialogs and notify that user needs to make some choices.
    ====> * verify_check_results
            Check all generated results messages and notify user about them.
    
    Debug output written to /var/log/leapp/leapp-preupgrade.log
    
    ============================================================
                               REPORT                           
    ============================================================
    
    A report has been generated at /var/log/leapp/leapp-report.json
    A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                           END OF REPORT                        
    ============================================================
    
    Answerfile has been generated at /var/log/leapp/answerfile
    

     

    Performing the upgrade from RHEL 7 to RHEL 8

    In case you get this error(XFS ftype=0) during leapp upgrade , try the solution below and try leapp upgrade again from the same terminal.

    2023-09-06 12:29:24.164 ERROR    PID: 30154 leapp.workflow.Download.dnf_package_download: DNF execution failed: 
    
    ============================================================
                               ERRORS                           
    ============================================================
    
    2023-09-06 12:29:25.674732 [ERROR] Actor: dnf_package_download
    Message: There is not enough space on the file system hosting /var/lib/leapp directory to extract the packages.
    Summary:
        Hint: Please follow the instructions in the 'XFS ftype=0 case' section of the article at: link: https://access.redhat.com/solutions/5057391
    
    ============================================================
                           END OF ERRORS                        
    ============================================================
    
    
    Debug output written to /var/log/leapp/leapp-upgrade.log
    
    ============================================================
                               REPORT                           
    ============================================================
    
    A report has been generated at /var/log/leapp/leapp-report.json
    A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                           END OF REPORT                        
    ============================================================

     

    Create a python fileevaluate-ovl-size.py in /tmp and paste this code below:

    #!/usr/libexec/platform-python
    #
    # DISCLAIMER: this script is not supported by Red Hat.
    # Usage: ./eval-ovl-size.py
    # Give a rough estimate of the required available space to in-place upgrade.
    
    MIN_SIZE = 1024   # MB
    EXTRA_MARGIN = 15 # %
    
    import os, os.path, subprocess
    
    def _shell(command):
        # works with python2.7 (el7) as well as python3 (el8)
        p = subprocess.Popen(command,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         close_fds=True,
                         shell=True,
                         universal_newlines=True)
        output = []
        while True:
            line = p.stdout.readline().rstrip('\n')
            if line:
                output.append(line)
            else:
                break
        return output
    
    def get_rpms_size():
        rpms_size = 0
        for size in _shell("rpm -qa --queryformat '%{SIZE}\n'"):
            rpms_size += int(size)
        return rpms_size
    
    def get_xfs_ftype(mp):
        return int(_shell("xfs_info %s | grep -o ftype=." % mp)[0].split('=')[1])
    
    def find_mnt(path):
        path = os.path.abspath(path)
        while not os.path.ismount(path):
            path = os.path.dirname(path)
        return path
    
    def get_partitions():
        parts = []
        with open('/proc/mounts', 'r') as f:
            mounts = f.readlines()
        for mount in mounts:
            if not mount.startswith('/'):
                continue
            dev, mp, fstype, opts, _5, _6 = mount.split(' ')
            if mp.startswith('/run'):
                continue
            p = os.statvfs(mp)
            parts.append({
              'mp': mp,
              'fstype': fstype,
              'ftype': get_xfs_ftype(mp) if fstype == 'xfs' else -1,
              'avail': p.f_bavail * p.f_frsize
            })
        return parts
    
    def iter_parts(lmp):
        avail = 0
        xfs_parts = 0
        ftype_case = 0
        for p in get_partitions():
            if p['mp'] == lmp:
                avail = int(p['avail'] / 1024**2)
            if p['fstype'] == 'xfs':
                xfs_parts += 1
            if p['ftype'] == 0:
                ftype_case += 1
        return avail, xfs_parts, ftype_case
    
    def show_eval(lmp, avail, xfs_parts, ftype_case, rpms_size):
        print("== Summary ==")
        print("/var/lib/leapp resides on the %s partition" % lmp)
        print("Current available space in %s: %s MB" % (lmp, avail))
        print("Installed size for all RPMs: %s MB" % rpms_size)
        if xfs_parts and ftype_case:
            ovl_size = int(rpms_size + (rpms_size * EXTRA_MARGIN / 100))
            ovl_size = max(ovl_size, 2048) # don't use less than the default
            required = (ftype_case * ovl_size) + MIN_SIZE
            print("\n== XFS ftype=0 case ==")
            if ovl_size > 2048:
                print("-> Adjust $LEAPP_OVL_SIZE before running Leapp:\n" \
                      "\t# export LEAPP_OVL_SIZE=%s" % ovl_size)
            print("-> Required space in the %s partition is:\n" \
                  "\tNumberOfXfsMountedPartitions * LEAPP_OVL_SIZE = %s MB" % (lmp, required))
            if avail < required:
                estimated = required - avail + 1
                print("There is not enough space in %s, extend it at least by %s MB" % (lmp, estimated))
            print("-> If Leapp/DNF requires again more space:\n" \
                  "\t- adjust $LEAPP_OVL_SIZE with a bigger size\n" \
                  "\t- AND extend the %s partition accordingly." % lmp)
        else:
            required = int(rpms_size + (rpms_size * EXTRA_MARGIN / 100) + MIN_SIZE)
            print("\n== Standard case ==")
            if avail < required:
                estimated = required - avail + 1
                print("There is not enough space in %s, extend it at least by %s MB" % (lmp, estimated))
            print("-> If Leapp/DNF requires again more space, you need to extend the %s partition." % lmp)
        print("\nFor more information, please read https://access.redhat.com/solutions/5057391")
    
    if __name__ == '__main__':
        lmp = find_mnt('/var/lib/leapp')
        avail, xfs_parts, ftype_case = iter_parts(lmp)
        rpms_size = int(get_rpms_size() / 1024**2)
        show_eval(lmp, avail, xfs_parts, ftype_case, rpms_size)

     

    Make the script executable and then run it:

    chmod +x  evaluate-ovl-size.py
    ./evaluate-ovl-size.py

    Expected output:

    [root@host01 tmp]# ./evaluate-ovl-size.py
    == Summary ==
    /var/lib/leapp resides on the /var partition
    Current available space in /var: 48529 MB
    Installed size for all RPMs: 3127 MB
    
    == XFS ftype=0 case ==
    -> Adjust $LEAPP_OVL_SIZE before running Leapp:
     # export LEAPP_OVL_SIZE=3596
    -> Required space in the /var partition is:
     NumberOfXfsMountedPartitions * LEAPP_OVL_SIZE = 22600 MB
    -> If Leapp/DNF requires again more space:
     - adjust $LEAPP_OVL_SIZE with a bigger size
     - AND extend the /var partition accordingly.
    
    
    For more information, please read https://access.redhat.com/solutions/5057391
    

     

    Run the below command  as suggested by the ouput above and try leapp upgrade again. This will consume more space than normal in /var. Please ensure that /var has enough space.

    export LEAPP_OVL_SIZE=3596

     

    Leapp Upgrade

    Before the actual upgrade happens, Leapp performs the leapp preupgrade phase to ascertain that the system is upgradable. If the system is upgradable, Leapp downloads necessary data and prepares an RPM transaction for the upgrade process.

    # leapp upgrade --target 8.9
    
    
    ==> Processing phase configuration_phase
    ====> * ipu_workflow_config
            IPU workflow config actor
    ==> Processing phase FactsCollection
    ====> * scanzfcp
            In case of s390x architecture, check whether ZFCP is used.
    ====> * tcp_wrappers_config_read
            Parse tcp_wrappers configuration files /etc/hosts.{allow,deny}.
    ====> * scan_pkg_manager
            Provides data about package manager (yum/dnf)
    ====> * scan_grub_device_name
            Find the name of the block device where GRUB is located
    ====> * source_boot_loader_scanner
            Scans the boot loader configuration on the source system.
    ====> * scan_subscription_manager_info
            Scans the current system for subscription manager information
    
    ...
    
    ==> Processing phase TargetTransactionFactsCollection
    ====> * create_iso_repofile
            Create custom repofile containing information about repositories found in target OS installation ISO, if used.
    ====> * target_userspace_creator
            Initializes a directory to be populated as a minimal environment to run binaries from the target system.
    Red Hat Enterprise Linux 8 for x86_64 - AppStre 2.3 MB/s |  59 MB     00:25    
    Red Hat Enterprise Linux 8 for x86_64 - BaseOS  3.0 MB/s |  63 MB     00:21    
    Last metadata expiration check: 0:00:16 ago on Sun Sep  3 22:15:16 2023.
    Dependencies resolved.
    ================================================================================
     Package                       ArchVersion                        Repository                       Size
    ================================================================================
    Installing:
     dnf-plugins-core              noarch4.0.21-19.el8_8                rhel-8-for-x86_64-baseos-rpms    75 k
     dnf                           noarch4.7.0-16.el8_8                 rhel-8-for-x86_64-baseos-rpms    542 k
    Installing dependencies:
     python3-systemd               x86_64234-8.el8                      rhel-8-for-x86_64-appstream-rpms 81 k
     xkeyboard-config              noarch2.28-1.el8                     rhel-8-for-x86_64-appstream-rpms 782 k
     unbound-libs                  x86_641.16.2-5.el8                   rhel-8-for-x86_64-appstream-rpms 574 k
     libevent                      x86_642.1.8-5.el8                    rhel-8-for-x86_64-baseos-rpms    253 k
     libassuan                     x86_642.5.1-3.el8                    rhel-8-for-x86_64-baseos-rpms    83 k
     json-glib                     x86_641.4.4-1.el8                    rhel-8-for-x86_64-baseos-rpms    144 k
     cracklib                      x86_642.9.6-15.el8                   rhel-8-for-x86_64-baseos-rpms    93 k
    redhat-release-eula           x86_648.8-0.8.el8                    rhel-8-for-x86_64-baseos-rpms    21 k
     elfutils-debuginfod-client    x86_640.188-3.el8                    rhel-8-for-x86_64-baseos-rpms    75 k
     openssl-pkcs11                x86_640.4.10-3.el8                   rhel-8-for-x86_64-baseos-rpms    66 k
     systemd                       x86_64239-74.el8_8.3                 rhel-8-for-x86_64-baseos-rpms    3.6 M
    
    ...
    
    Transaction Summary
    ================================================================================
    Install  200 Packages
    
    Total download size: 111 M
    Installed size: 707 M
    Downloading Packages:
    (1/200): pinentry-1.1.0-2.el8.x86_64.rpm         84 kB/s | 100 kB     00:01    
    (2/200): libxkbcommon-0.9.1-1.el8.x86_64.rpm     88 kB/s | 116 kB     00:01 
    
    ...
    
    (200/200): grub2-tools-minimal-2.02-148.el8_8.1 489 kB/s | 213 kB     00:00    
    --------------------------------------------------------------------------------
    Total                                           2.4 MB/s | 111 MB     00:46     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Running scriptlet: filesystem-3.8-6.el8.x86_64                            1/1 
      Preparing        :                                                        1/1 
      Installing       : libgcc-8.5.0-18.el8.x86_64                           1/200 
      Running scriptlet: libgcc-8.5.0-18.el8.x86_64                           1/200 
      Installing       : crypto-policies-20221215-1.gitece0092.el8.noarch     2/200 
      Running scriptlet: crypto-policies-20221215-1.gitece0092.el8.noarch     2/200 
    
    ...
    
      Verifying        : grub2-common-1:2.02-148.el8_8.1.noarch             198/200 
      Verifying        : curl-7.61.1-30.el8_8.3.x86_64                      199/200 
      Verifying        : grub2-tools-minimal-1:2.02-148.el8_8.1.x86_64      200/200 
    
    Installed:
      dnf-plugins-core-4.0.21-19.el8_8.noarch                                       
      dnf-4.7.0-16.el8_8.noarch                                                     
      pinentry-1.1.0-2.el8.x86_64                                                   
      libxkbcommon-0.9.1-1.el8.x86_64                                               
      python3-unbound-1.16.2-5.el8.x86_64                                           
      hardlink-1:1.3-6.el8.x86_64                                                   
      shared-mime-info-1.9-3.el8.x86_64                                             
      diffutils-3.6-6.el8.x86_64              
    
    ...
    
    Transaction Summary
    =============================================================================================================================================================
    Install     523 Packages
    Upgrade    1283 Packages
    Remove      243 Packages
    Downgrade    21 Packages
    
    Total size: 1.7 G
    Total download size: 1.6 G
    DNF will only download packages, install gpg keys, and check the transaction.
    Downloading Packages:
    
    [SKIPPED] grub2-tools-minimal-2.02-148.el8_8.1.x86_64.rpm: Already downloaded  
    (201/1824): perl-Compress-Raw-Zlib-2.081-1.el8.  72 kB/s |  68 kB     00:00    
    (202/1824): adwaita-gtk2-theme-3.22.3-4.el8.x86 125 kB/s | 132 kB     00:01    
    (203/1824): libcacard-2.7.0-2.el8_1.x86_64.rpm  174 kB/s |  52 kB     00:00    
    (204/1824): atk-2.28.1-1.el8.x86_64.rpm         446 kB/s | 272 kB     00:00    
    (205/1824): glusterfs-cli-6.0-56.4.el8.x86_64.r 463 kB/s | 194 kB     00:00    
    (206/1824): glusterfs-api-6.0-56.4.el8.x86_64.r 329 kB/s |  99 kB     00:00 
    ....
    
    (1824/1824): linux-firmware-20230404-114.git2e9 1.5 MB/s | 264 MB     02:50
       
    --------------------------------------------------------------------------------
    Total                                           2.7 MB/s | 1.6 GB     09:42     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Complete!
    The downloaded packages were saved in cache until the next successful transaction.
    You can remove cached packages by executing 'dnf clean packages'.
    ==> Processing phase InterimPreparation
    ====> * remove_upgrade_artifacts
            Removes artifacts left over by previous leapp runs
    ====> * efi_interim_fix
            Adjust EFI boot entry for first reboot
    ====> * upgrade_initramfs_generator
            Creates the upgrade initramfs
    ====> * dnf_dry_run
            Actor that invokes DNF to download the RPMs required for the upgrade transaction.
    Applying transaction workaround - remove obsolete RPM GPG keys from RPM DB
    
    Applying transaction workaround - yum config fix
    
    Applying transaction workaround - import trusted gpg keys to RPM DB
    
    Last metadata expiration check: 0:18:31 ago on Sun Sep  3 22:15:16 2023.
    Dependencies resolved.
    =============================================================================================================================================================
     Package                                          Arch    Version                                                     Repository                         Size
    =============================================================================================================================================================
    Installing:
     adcli-doc                                        noarch  0.9.2-1.el8                                                 rhel-8-for-x86_64-baseos-rpms      75 k
     alsa-utils-alsabat                               x86_64  1.2.8-1.el8                                                 rhel-8-for-x86_64-appstream-rpms   46 k
     anaconda-install-env-deps                        x86_64  33.16.8.9-1.el8_8                                           rhel-8-for-x86_64-appstream-rpms  198 k
    
    ...
    
    Transaction Summary
    =============================================================================================================================================================
    Install     523 Packages
    Upgrade    1283 Packages
    Remove      243 Packages
    Downgrade    21 Packages
    
    Total size: 1.7 G
    
    DNF will only download packages, install gpg keys, and check the transaction.
    Downloading Packages:
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Complete!
    ====> * add_upgrade_boot_entry
            Add new boot entry for Leapp provided initramfs.
    A reboot is required to continue. Please reboot your system.
    
    
    Debug output written to /var/log/leapp/leapp-upgrade.log
    
    ============================================================
                               REPORT                           
    ============================================================
    
    A report has been generated at /var/log/leapp/leapp-report.json
    A report has been generated at /var/log/leapp/leapp-report.txt
    
    ============================================================
                           END OF REPORT                        
    ============================================================
    
    Answerfile has been generated at /var/log/leapp/answerfile
    
    
    
    
    
    
    
    
    
    

     

    Reboot the system

    Once all the steps executed successfully, reboot the system. The system boots into a RHEL 8-based initial RAM disk image, initramfs. Leapp upgrades all packages and automatically reboots to the RHEL 8 system.

    Leapp Upgrade

     

    Once the system boots up, connect through ssh and verify the RHEL version:

     

     ssh [email protected]
    
    ***********WARNING*****************WARNING*****************WARNING*************
    *This system is for the use of authorized users only. Any or all uses of this *
    *system and all files on this system may be intercepted, monitored, recorded, *
    *copied, audited,inspected, and disclosed to authorized organizational and law*
    *enforcement personnel. Your access is strictly limited to applicable services*
    *of the system for which you have obtained written authorization, and will be *
    *governed by the organizations Security Policy & Acceptable Usage Standard.   *
    *                                                                             *
    * Unauthorized or improper use of this system is strictly prohibited and may  *
    *result in  administrative disciplinary action and/or civil charges/criminal  *
    *penalties. By continuing to use this system you indicate your awareness of   *
    *and consent to these terms and conditions of use. LOG OFF IMMEDIATELY (Press *
    *CTRL-D) if you do not agree to the conditions stated in  this warning.       *
    ************WARNING*****************WARNING*****************WARNING************
    
    [email protected]'s password: 
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
    [technnix@node01 ~]$ sudo -i
    [root@node01 ~]# cat /etc/os-release
    NAME="Red Hat Enterprise Linux"
    VERSION="8.8 (Ootpa)"
    ID="rhel"
    ID_LIKE="fedora"
    VERSION_ID="8.8"
    PLATFORM_ID="platform:el8"
    PRETTY_NAME="Red Hat Enterprise Linux 8.8 (Ootpa)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
    HOME_URL="https://www.redhat.com/"
    DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    
    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
    REDHAT_BUGZILLA_PRODUCT_VERSION=8.8
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="8.8"
    
    
    
    

     

    Post Upgrade Tasks

    1. Remove all packages from the excludelist:
    # yum config-manager --save --setopt exclude=''

     

    2. List and Remove old kernels for RHEL 7

    # yum list kernel
    Updating Subscription Management repositories.
    
    This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
    
    Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                                                                              1.6 MB/s |  59 MB     00:36    
    Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                                                                                 3.0 MB/s |  63 MB     00:21    
    Last metadata expiration check: 0:00:01 ago on Sun 03 Sep 2023 11:10:56 PM EAT.
    Installed Packages
    kernel.x86_64                                                                                      3.10.0-1160.88.1.el7                                                                                        @System
    kernel.x86_64                                                                                      3.10.0-1160.99.1.el7                                                                                        @System
    kernel.x86_64                                                                                      4.18.0-477.21.1.el8_8                                                                                       @System
    
    
    

     

    Uninstall 3.10.x kernels from the system for RHEL 7.

    # yum -y remove kernel-3.10.0-*
    
    Updating Subscription Management repositories.
    
    This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
    
    Dependencies resolved.
    ======================================================================================================================================================================================================================
     Package                                         Architecture                                    Version                                                       Repository                                        Size
    ======================================================================================================================================================================================================================
    Removing:
     kernel                                          x86_64                                          3.10.0-1160.88.1.el7                                          @System                                           66 M
     kernel                                          x86_64                                          3.10.0-1160.99.1.el7                                          @System                                           66 M
    
    Transaction Summary
    ======================================================================================================================================================================================================================
    Remove  2 Packages
    
    ...
    
    Removed:
      kernel-3.10.0-1160.88.1.el7.x86_64                                                                        kernel-3.10.0-1160.99.1.el7.x86_64                                                                       
    
    Complete!
    
    

     

    3. Remove remaining RHEL 7 packages, including the remaining Leapp packages.

    Determine old kernel versions:

    # cd /lib/modules && ls -ld *.el7*
    drwxr-xr-x. 3 root root   19 Jun 10 12:16 3.10.0-1160.59.1.el7.x86_64
    drwxr-xr-x  3 root root   19 Sep  3 20:49 3.10.0-1160.81.1.el7.x86_64
    drwxr-xr-x  7 root root 4096 Sep  3 22:54 3.10.0-1160.88.1.el7.x86_64
    drwxr-xr-x  7 root root 4096 Sep  3 22:54 3.10.0-1160.99.1.el7.x86_64
    drwxr-xr-x. 3 root root   19 Jan 27  2023 3.10.0-862.9.1.el7.x86_64
    

     

    Remove the modules and directories

    # rm -rf /lib/modules/*el7*
    
    
    
    

     

    5. Reboot the system

    # reboot

     

    Conclusion

    We have come to the end of this guide. I hope you managed to upgrade your system from RHEL 7 to RHEL 8. Keep it here for more similar articles.

    Recent Articles

    Related Articles

    Leave A Reply

    Please enter your comment!
    Please enter your name here