For organizations focused on cost control, Oracle product integration, and future-proofing their Linux strategy against vendor dependency, Oracle Linux (bolstered by the OpenELA initiative) offers several compelling business advantages over Red Hat Enterprise Linux (RHEL). The combination of free access, stable open source backing, enterprise-grade support, and interoperability provides a resilient foundation for enterprise workloads.

Thanks to the collaboration of different partners used to work with us on Oracle Linux, I’m glad to share one great guide that shows how to upgrade, in one shot, from Red Hat Enterprise Linux 7 to Oracle Linux 8. The example leverages Leapp and Elevate open source projects to execute migration and upgrade in one single step.

Step-by-step: guide

Here the steps to follow and possible recommendations while approaching this upgrade&migration process:

  • Ensure you have downloaded the required packages

# wget https://linux-update.oracle.com/rpms/uln_register_ol7.tgz
# wget https://linux-update.oracle.com/rpms/uln_register-gnome_ol7.tgz

                                        

  • To upgrade the existing packages already on your server, use the following command (assuming both the tar files are in the current directory):

# tar -xzf uln_register_ol7.tgz
# tar -xzf uln_register-gnome_ol7.tgz (only if rhn-setup-gnome is already installed)
# cd uln_migrate
# rpm -Uvh *.rpm –force

                                        
Note: if you don’t have rhn-setup-gnome installed, use the following command:
# tar -xzf uln_register_ol7.tgz
# cd uln_migrate
# rpm -Uvh *.rpm
                                     

  • Download and verify the Oracle Linux GPG Key:

# wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
# gpg –import /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
# cp /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle /etc/pki/rpm-gpg/RPM-GPG-KEY

[ OPTION 1 – Unbreakable Linux Network (ULN) ]

  • Register your system to ULN by running following command as root:

# uln_register

Note: add channels like “ol7_latest” and “ol7_developer_EPEL”
                                        
[ END OPTION 1 ]

[ OPTION 2 – Oracle Linux Yum Repository (yum.oracle.com) ]

Download the yum repository file and enable required repositories from ULN/yum.oracle.com, as root:

# wget http://yum.oracle.com/public-yum-ol7.repo -O /etc/yum.repos.d/public-yum-ol7.repo
# yum-config-manager –enable ol7_latest
# yum-config-manager –enable ol7_developer_EPEL

[ END OPTION 2]

  • Update your system to the latest packages avaialble for Oracle Linux 7

# yum update -y

  • Reinstall packages going to create conflicts during the upgrade process to Oracle Linux 8

# yum reinstall python-ipaddress python-backports python-backports-ssl_match_hostname python-six pycairo python-idna sysvinit-tools python-inotify yum-plugin-ulninfo -y

Note: the list of RPMs reinstalled above could change; while trying to execute “leapp upgrade” below, you could have RPM conflicts and if this happens, you only need to reinstall the RPM in conflict.

  • Remove the “yum-plugin-ulninfo” RPM package (the same will be replaced by the steps below on Oracle Linux 8)

# yum remove yum-plugin-ulninfo -y

  • Reboot your system

# reboot

  • Once rebooted, enable UEKR7 for OL8 for Elevate/Leapp process

# sed -i ‘s/UEKR6/UEKR7/g’ /etc/leapp/files/leapp_upgrade_repositories.repo
# sed -i ‘s/UEKR6/UEKR7/g’ /etc/leapp/files/repomap.json
# sed -i ‘s/Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux/Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux/g’ /etc/leapp/files/leapp_upgrade_repositories.repo

  • Remove possible packages creating issues to Elevate (in the example below, “libblockdev” will be reinstalled by the upgrade process)

# dnf remove libblockdev -y

  • Install the “elevate” release RPM to get access to Elevate binaries

# yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el$(rpm –eval %rhel).noarch.rpm

  • Install “leapp” packages and migration data for Oracle Linux, as the target to migrate to

# yum install -y leapp-upgrade leapp-data-oraclelinux

The preupgrade check can be used anytime to assess the status of a system and identify where conflicts may occur. It does not change the system, but creates report files and a debug log, containing information about the system, its configuration, and potential upgrade issues.

  • Run the leapp preupgrade command to start the preupgrade process

# leapp preupgrade

  • Check on possible inhibitors and manage them (here my example)

# modprobe -r pata_acpi
# leapp answer –section remove_pam_pkcs11_module_check.confirm=True

Note: A leapp-report.txt file and an answerfile are created, and debug information is saved in a leapp-preupgrade.log file. Check those files to address possible upgrade issues; for further details you can check “leapp” documentation for Oracle Linux 8

  • Start the upgrade. You’ll be offered to reboot the system after this process is completed.

# leapp upgrade
# reboot

  • After reboot, login to the system and check how the migration went. Verify that the current OS is Oracle Linux 8 to then check packages left from CentOS 7 that could be removed or updated manually; finally, look at the upgrade logs to check the upgrade process correctly completed.

# cat /etc/oracle-release
# cat /etc/os-release
# cat /var/log/leapp/leapp-report.txt
# cat /var/log/leapp/leapp-upgrade.log

  • Cleanup the old el7 RPM packages

# dnf remove `rpm -qa |grep el7|xargs`

  • Cleanup the yum configuration by executing the following command

# rm -f /etc/yum.repos.d/*.repo

  • Create a temporary yum repository configuration file /etc/yum.repos.d/ol8-temp.repo with the following as the minimum required content:

[ol8_baseos_latest]
name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

  • Install oraclelinux-release-el8 RPM to properly configure Yum

# dnf install oraclelinux-release-el8 -y

  • Remove ol8-temp.repo and any other remaining repo files that may conflict with Oracle Linux yum server:

# mv /etc/yum.repos.d/ol8-temp.repo /etc/yum.repos.d/ol8-temp.repo.disabled

  • Finally you can check possible logs and report by pointing to “/var/log/leapp/leapp-report.txt” and “/var/log/leapp/leapp-upgrade.log” files.

Migration and upgrade resources

Training

www.oracle.com/goto/oltrain

GitHub

Social Media