Upgrade Oracle Linux 7 to 8 Using Leapp

by Ramses Soto-Navarro ramses@sotosystems.com, 7/27/2022

Overview
Pre-install Steps
Run Leapp Pre-upgrade
Verify Version 8 Local Repo
Run Leapp Upgrade
Verify New OS
Remove Old Kernels


Overview

Brief notes on how to run an online upgrade of Oracle Linux 7 to 8 using Leapp. Audience is experienced Linux administrators.


Pre-install Steps

  • Verify the /boot directory as empty as possible.
  • Verify that /tmp/ is in the root directory.
  • Remove NFS software: yum remove nfs-utils
  • Disable any unecessary mounts: vi /etc/fstab
  • Add proxy to yum: echo “proxy=http://172.24.80.26:3128” >> /etc/yum.conf
  • Clear yum lock: yum versionlock clear
  • Verify at least 20GB of free space on /var/ and /root/.
  • Disable all services except SSH.
  • Unregister from ULN.
  • Disable or remove Ksplice?
  • Disable any remote authentication, if using.
  • Verify locality: # cat /etc/locale.conf: LANG=”en_US.UTF-8”
  • Set locality: ocalectl set-locale LANG=en_US.UTF-8

    Record the current OS version:

    # cat /etc/os-release | tee ~/old-os-release.txt
    

    Install Leapp and run the pre-upgrade:

    # yum install leapp
    

    Alternative install:

    # yum install -y leapp --enablerepo=ol7_leapp,ol7_latest
    

    Run Leapp Pre-upgrade

    # leapp preupgrade --oraclelinux
    

    To diagnose pre-requesites review the log and answer file:

    # less /var/log/leapp/leapp-preupgrade.log
    # less /var/log/leapp/answerfile
    

    Example answer fix:

    # leapp answer --section remove_pam_pkcs11_module_check.confirm=True
    
    # less /var/log/leapp/leapp-report.txt

    Verify Version 8 Local Repo

    Verify that all necessary repositories for both version 7 and 8 are defined and enabled.

    # cat /etc/yum.repos.d/leapp-upgrade-repos-ol8.repo
    [ol8_baseos_latest]
    name=Oracle Linux 8 BaseOS Latest ($basearch)
    baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/baseos/latest/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    
    # yum repolist
    
    # yum install -y leapp-upgrade --enablerepo=ol7_leapp, ol7_latest
    
    # sudo sed -i '/^enabled=0.*/a proxy=http://172.24.80.26:3128' /etc/yum.repos.d/leapp-upgrade-repos-ol8.repo
    

    Run Leapp Upgrade

    # screen
    
    # leapp upgrade --oraclelinux
    

    Verify New OS

    It will boot to the OS-Upgrade boot entry, then resume to normal boots thereafter.

    Verify that version 8 is now running:

    # cat /etc/oracle-release
    # uname -r
    

    Verify the new kernel:

    # grubby --default-kernel
    
  • Enable services.
  • Enable mounts.
  • rm -fr /root/tmp_leapp_py3
  • Register with ULN again.
  • Enable Ksplice again then reboot; then run it.

    Remove Old Kernels

    # package-cleanup --oldkernels
    # package-cleanup --problems
    
    # grubby --remove-kernel=vmlinuz-5.4.17-2011.6.2.el7uek.x86_64
    # grubby --info=ALL | grep kernel
    
    # yum clean all
    # sync
    

    ==== Links ====

  • https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/upgrading_from_rhel_7_to_rhel_8/index
  • https://linuxhint.com/upgrade_rhel7_rhel8/
  • https://docs.oracle.com/en/learn/ol-linux-leapp/index.html
  • https://docs.oracle.com/cd/F22978_01/8/leapp/F36401.pdf
  • https://docs.oracle.com/en/operating-systems/oracle-linux/8/leapp/leapp-AboutLeapp.html#upgradingOL7Kvms

    The End.