Share on Social Media

In this Linux tutorial, you will learn how to migrate CentOS 8 to Oracle Linux, which is another CentOS alternative from the third largest software company in the world. #centlinux #linux #oracle

What is Oracle Linux?

Oracle Linux is a Linux distribution packaged and freely distributed by Oracle, available partially under the GNU General Public License since late 2006. It is compiled from Red Hat Enterprise Linux source code, replacing Red Hat branding with Oracle’s. It is also used by Oracle Cloud and Oracle Engineered Systems such as Oracle Exadata and others.

Oracle Linux is free to download from Oracle E-delivery service under GNU GPL License, but the technical Support has a cost.

Oracle Linux is shipped with two Kernels, first is the default Linux Kernel compiled from the source code of respective Red Hat Enterprise Linux (RHEL) version.

While the second is the Unbreakable Enterprise Kernel (UEK), Which is a Linux kernel built by Oracle and supported through Oracle Linux support. Its focus is performance, stability, and minimal backports by tracking the mainline source code as closely as is practical. UEK is well-tested and used to run Oracle’s Engineered Systems, Oracle Cloud Infrastructure, and large enterprise deployments for Oracle customers.

Recommended Book: Practical Guide to Linux Commands, Editors, and Shell Programming (PAID LINK) by Mark Sobell & Matthew Helmke
Recommended Online Training: Learn Bash Shell in Linux for Beginners

745772 0021

Environment Specification

We are using a minimal CentOS 8 virtual machine with following specifications.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 2 GB
  • Storage – 20 GB
  • Operating System – CentOS 8.2
  • Hostname – centos-8.centlinux.com
  • IP Address – 192.168.116.230 /24

Checking Current Linux OS

By using a SSH client, connect with centos-8.centlinux.com as root user.

Execute following commands to check the version of your Linux operating system.

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

# cat /etc/centos-release
CentOS Linux release 8.3.2011

Check the version of current Linux Kernel.

# uname -r
4.18.0-240.1.1.el8_3.x86_64

Migrate CentOS 8 to Oracle Linux

Oracle’s GitHub Repository provides a Linux bash script centos2ol.sh. This script supports migration from CentOS Linux 6, 7 & 8 but it do not supports CentOS Stream.

You can easily download centos2ol.sh script from GitHub by using the wget or curl commands.

# wget https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
--2021-07-10 19:37:18--  https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21609 (21K) [text/plain]
Saving to: ‘centos2ol.sh’

centos2ol.sh        100%[===================>]  21.10K  8.51KB/s    in 2.5s

2021-07-10 19:37:34 (8.51 KB/s) - ‘centos2ol.sh’ saved [21609/21609]

Grant execution permissions on centos2ol.sh to everyone.

# chmod +x centos2ol.sh

According to centos2ol.sh documentation, please check and adjust following prerequisites.

  1. Because of the GRUB2 BootHole vulnerability, our SecureBoot shim can only boot kernels signed by Oracle and we can only replace the default CentOS kernels. While this may not have an impact if SecureBoot is currently disabled, enabling it at a later date could render the system unbootable. For that reason, we strongly recommend removing all non-standard kernels, i.e. any kernel that is installed that is not provided by either the base or updates repo. This includes the centosplus kernels.
  2. Ensure your CentOS yum or dnf configuration is working, i.e. there are no stale repositories.
  3. Disable all non-CentOS repositories. You can re-enable the repos after the switch.
  4. Ensure you have at least 5GB of free space in /var/cache.
  5. All automatic updates, e.g. via yum-cron should be disabled.

When ready, execute centos2ol.sh script to start migration process for your Linux operating system.

# ./centos2ol.sh
Checking for required packages...
Checking your distribution...
package epel-release is not installed
Checking for yum lock...
Checking for required python packages...
Identifying dnf modules that are enabled
Finding your repository directory...
Learning which repositories are enabled...
Repositories enabled before update include:
appstream
baseos
extras
Looking for yumdownloader...
Backing up and removing old repository files...
Removing CentOS-specific yum configuration from /etc/yum.conf
Downloading Oracle Linux release package...

The centos2ol.sh script list down the installed packages and then replaces the CentOS standard yum repositories with that of Oracle Linux.

centos2ol.sh downloading packages
centos2ol.sh downloading packages
centos2ol.sh installing packages
centos2ol.sh installing packages

During the migration process your Linux operating system packages has been replaced by the respective Oracle Linux supported software packages.

centos2ol completed migration
centos2ol completed migration

centos2ol.sh script has finished it’s work. Reboot your machine to start your operating system with new Linux Kernel.

# reboot

During system startup, the GRUB menu is now displaying two new entries for Oracle Linux Server. One for the standard Linux kernel, while the other is for the Unbreakable Enterprise Kernel (UEK).

Boot your Linux server with UEK.

oracle linux grub menu
oracle linux grub menu

After successful startup, you will reach at the Linux commandline (CLI) based login prompt.

oracle linux cli login
oracle linux cli login

Login as root user.

Checking New Linux Operating System

Check the current operating system version by executing following commands.

# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:4:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.4
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.4

# cat /etc/oracle-release
Oracle Linux Server release 8.4

Also check the version of your new Linux Kernel.

# uname -r
5.4.17-2102.202.5.el8uek.x86_64

Final Thoughts

Embarking on the journey to migrate from CentOS 8 to Oracle Linux is a strategic move towards stability and reliability. Our comprehensive guide ensures a smooth transition, safeguarding your data and maintaining operational continuity.

For personalized assistance or specialized requirements during the migration process, I offer expert services tailored to your needs. Explore my expertise and service offerings on my Fiverr profile:

Linux System Administration

Let me guide you through the migration journey, ensuring a seamless shift from CentOS 8 to Oracle Linux, and empowering your system with enhanced performance and support.

Leave a Reply