Migrate CentOS 8 Operating System to Oracle Linux - CentLinux

Latest

Monday, 12 July 2021

Migrate CentOS 8 Operating System to Oracle Linux

migrate-centos-8-operating-system-to-oracle-linux

Oracle Linux is another alternative to CentOS 8. In this article, you will see how to migrate your existing operating system to Oracle Linux.

 

Table of Contents:

 

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 by Mark Sobell & Matthew Helmke

Recommended Training:1Z0-409 Oracle Linux Fundamentals Certified Practice Exam

 

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 Operating System:

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 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.

01-centos2ol-downloading-packages

02-centos2ol-installing-packages

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

03-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.

04-oracle-linuxx-grub-boot-menu

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

05-oracle-linux-cli-login-prompt

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

 

Conclusion:

Your CentOS 8 operating system has been successfully migrated to Oracle Linux and the Unbreakable Enterprise Kernel. Try experimenting with your new operating system and find out is it a good CentOS alternative?

No comments:

Post a Comment