3.Use Oracle Linux and Discover the Differences

Previously, we explained what a RHEL-compatible distribution is and the features of Oracle Linux. This time, we will actually operate Oracle Linux to explain the differences with RHEL and CentOS.

1. How to try Oracle Linux

You can easily try Oracle Linux in the following ways. This time, we will mainly use method 1, and partially use method 2.

  1. Install Oracle Linux on VirtualBox or similar.
  2. Use the Oracle Cloud Infrastructure Always Free
  3. Use an Oracle Linux image in AWS or Azure

In addition, Oracle Linux media can be obtained free of charge from the following sites:

For installation instructions, see the “Installing Oracle Linux 8 Oracle Linux” manual. It is almost the same as RHEL, CentOS Stream and AlmaLinux. In addition, we recommend “OCI Documentation:Oracle Linux” for Oracle Cloud Infrastructure.

2. Discover the differences of Oracle Linux

Let’s take a look at Oracle Linux in action. This time we will use Oracle Linux 8 Update 6. Even if the minor version is different, it is almost the same, so there is no need to worry about this point. Oracle Linux 7 is also basically the same. This time, we will use the following Linux distributions for comparison:

  • Red Hat Enterprise Linux 8
  • CentOS Stream

CentOS Stream is not a pure RHEL-compatible distribution. Therefore, AlmaLinux and MIRACLE LINUX are more appropriate for comparison, but this time we will use CentOS Stream, which is easier to get used to.

2.1. Check the distribution type

Check the Linux distribution type. Linux has a file called /etc/*-release, which allows you to determine the distribution. If you check, there are four files called /etc/*-release.

$ ls -l /etc/*release
-rw-r--r--. 1 root root  32 May 13 10:14 /etc/oracle-release
-rw-r--r--. 1 root root 479 May 13 10:14 /etc/os-release
-rw-r--r--. 1 root root  45 May 13 10:14 /etc/redhat-release
lrwxrwxrwx. 1 root root  14 May 13 10:14 /etc/system-release -> oracle-release

If you look at the contents of the file, you can see that it is Oracle Linux 8.6.

$ cat /etc/oracle-release
Oracle Linux Server release 8.6

However, you do not need to worry about the minor version after the decimal place in Linux. This is because, depending on the repository settings, running yum update will cause the minor version to go up on its own.

What is interesting is the contents of /etc/redhat-release. It is a Red Hat Enterprise Linux release, not Oracle Linux.

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 (Ootpa)

But what about CentOS Stream? /etc/redhat-release is a symbolic link to /etc/centos-release. Of course, the content is the same.

$ ls -l /etc/*release
-rw-r--r--. 1 root root 24 Sep 14  2021 /etc/centos-release
lrwxrwxrwx. 1 root root 21 Sep 14  2021 /etc/os-release -> ../usr/lib/os-release
lrwxrwxrwx. 1 root root 14 Sep 14  2021 /etc/redhat-release -> centos-release
lrwxrwxrwx. 1 root root 14 Sep 14  2021 /etc/system-release -> centos-release

$ cat /etc/centos-release
CentOS Stream release 8

$ cat /etc/redhat-release ★It has the same content
CentOS Stream release 8

It seems that this specification is a countermeasure for the program that checks the type of distribution. Commercial software and drivers provided by hardware vendors often use /etc/*-release to determine the type and version of the distribution. This is probably because they expect to bypass the check by leaving the original /etc/redhat-release.

2.2. Check the kernel

Check the kernel. Since the end is el8uek, it is not a RHEL-compatible kernel, but a unique Unbreakable Enterprise Kernel (UEK) of Oracle Linux.

$ uname -r
5.4.17-2136.307.3.1.el8uek.x86_64

If you look at the kernel that is installed, you can see that in addition to the UEK, the RHEL-compatible kernel (RHCK: Red Hat Compatible Kernel) is also installed.

$ rpm -qa | grep kernel
kernel-uek-5.4.17-2136.307.3.1.el8uek.x86_64 ★UEK
kernel-modules-4.18.0-372.9.1.el8.x86_64
kernel-tools-libs-4.18.0-372.9.1.el8.x86_64
kernel-4.18.0-372.9.1.el8.x86_64             ★RHEL compatible kernel
kernel-tools-4.18.0-372.9.1.el8.x86_64
kernel-core-4.18.0-372.9.1.el8.x86_64
kernel-headers-4.18.0-372.9.1.el8.x86_64

With UEK and RHCK, you will see that the version number is very different.

  • UEK:kernel-uek-5.4
  • RHCK:kernel-4.18

The reason for the significant difference in versions is the difference in the Linux kernel on which they are based. UEK is based on the more upstream Linux kernel 5.4, with customizations specific to Oracle Linux and application compatibility with RHCK.

UEK and RHCK are application level compatible, so they are usually fine as they are. You may want to consider switching when the software, device drivers, etc. you are using do not support UEK.

2.3. Discover the RHEL compatible kernel

The following table shows the relationship between the RHEL-compatible distribution and the kernel version. The “version number” does not change if it is the same major version. What changes is the release number following the kernel version.

Distributionkernel version
RHEL8-basedkernel-4.18.0
RHEL7-basedkernel-3.10.0
RHEL6-basedkernel-2.6.32

The following figure shows the kernel package naming convention. If it is the same major version, the “version number” will remain the same, and the “release number” will increase. For the RHEL-compatible kernel in Oracle Linux, the same kernel as RHEL is released up to the release number.

Let’s take a look at the changelog (change history) of the RHEL-compatible kernel for reference. Version 4.18.0-372.9.1.el8 seems to apply a few compatibility patches, such as keys, without changing. If you are interested, please see the Source Package (SRPM).

# rpm -q --changelog kernel-4.18.0-372.9.1.el8.x86_64|head
* Wed May 11 2022 Natalya Naumova <natalya.naumova@oracle.com> [4.18.0-372.9.1.el8.OL8]
- Update Oracle Linux certificates (Kevin Lyons)
- Disable signing for aarch64 (Ilya Okomin)
- Oracle Linux RHCK Module Signing Key was added to the kernel trusted keys list (olkmod_signing_key.pem) [Orabug: 29539237]
- Update x509.genkey [Orabug: 24817676]
- Conflict with shim-ia32 and shim-x64 <= 15-11.0.5.el8

* Fri Apr 15 2022 Augusto Caringi <acaringi@redhat.com> [4.18.0-372.9.1.el8]
- scsi: qedi: Fix failed disconnect handling (Chris Leech) [2071519]
- scsi: iscsi: Fix unbound endpoint error handling (Chris Leech) [2071519]

2.4. Check the Yum repository

Check the Yum repository. Unlike RHEL, with Oracle Linux you can get update packages without a support contract (RH is a subscription contract). However, if you sign a support contract, you can also use packages for support contract users such as Ksplice.

By default, the following repositories are enabled. In addition, from Oracle Linux 8, it has changed from yum to dnf, but because it is compatible, yum is used intentionally.

$ yum repolist
repo id           repo name
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)

The content of each repository is as follows:

RepositoryExplanation
ol8_baseos_latestCore packages for OS
ol8_appstreamApplications, development languages, etc.
ol8_UEKR6UEK R6

Oracle Linux 8 for Oracle Cloud Infrastructure is configured as follows. OCI-specific and Ksplice repositories are enabled.


ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_addons        Oracle Linux 8 Addons (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
ol8_ksplice       Ksplice for Oracle Linux 8 (x86_64)
ol8_oci           Oracle Linux 8 OCI Packages (x86_64)
ol8_oci_included  Oracle Software for OCI users on Oracle Linux 8 (x86_64)

Let’s check with other distributions as well. The number of repositories enabled by default is different, but the usual baseos and appstream are the same.

RHEL8

repo id                          repo name
rhel-8-for-x86_64-appstream-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms    Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

CentOS Stream

repo id             repo name
appstream           CentOS Stream 8 - AppStream
baseos              CentOS Stream 8 - BaseOS
epel                Extra Packages for Enterprise Linux 8 - x86_64
epel-modular        Extra Packages for Enterprise Linux Modular 8 - x86_64
extras              CentOS Stream 8 - Extras
extras-common       CentOS Stream 8 - Extras common packages

Repository ID differences between Oracle Linux and other distributions

Oracle LinuxRHELCentOS Stream
ol8_baseos_latestrhel-8-for-x86_64-baseos-rpmsbaseos
ol8_appstreamrhel-8-for-x86_64-appstream-rpmsappstream

The following is displayed up to the repository that is disabled:

$ yum repolist all
repo id                    repo name                                    status
ol8_UEKR6                  Latest Unbreakable Enterprise Kernel Release enabled
ol8_UEKR6_RDMA             Oracle Linux 8 UEK6 RDMA (x86_64)            disabled
ol8_addons                 Oracle Linux 8 Addons (x86_64)               disabled
ol8_appstream              Oracle Linux 8 Application Stream (x86_64)   enabled
ol8_baseos_latest          Oracle Linux 8 BaseOS Latest (x86_64)        enabled
ol8_codeready_builder      Oracle Linux 8 CodeReady Builder (x86_64) -  disabled
ol8_distro_builder         Oracle Linux 8 Distro Builder (x86_64) - Uns disabled
ol8_kvm_appstream          Oracle Linux 8 KVM Application Stream (x86_6 disabled
ol8_u0_baseos_base         Oracle Linux 8 BaseOS GA (x86_64)            disabled
ol8_u1_baseos_base         Oracle Linux 8.1 BaseOS (x86_64)             disabled
ol8_u2_baseos_base         Oracle Linux 8.2 BaseOS (x86_64)             disabled
ol8_u3_baseos_base         Oracle Linux 8.3 BaseOS (x86_64)             disabled
ol8_u4_baseos_base         Oracle Linux 8.4 BaseOS (x86_64)             disabled
ol8_u4_security_validation Oracle Linux 8 Update 4 (x86_64) Security Va disabled
ol8_u5_baseos_base         Oracle Linux 8.5 BaseOS (x86_64)             disabled
ol8_u6_baseos_base         Oracle Linux 8.6 BaseOS (x86_64)             disabled

In addition, some repositories are not installed by default. The yum list available command displays a list of packages that contain repository definitions. For example, oracle-epel-release-el8 is an “EPEL” repository commonly used in RHEL-based distributions. Simply run yum install oracle-epel-release-el8 to make the EPEL package available.

$ yum list available *release-el8.x86_64
Available Packages
mysql-release-el8.x86_64                         1.0-3.el8     ol8_baseos_latest
oracle-epel-release-el8.x86_64                   1.0-5.el8     ol8_baseos_latest
oracle-gluster-release-el8.x86_64                1.0-2.el8     ol8_baseos_latest
oracle-instantclient-release-el8.x86_64          1.0-1.el8     ol8_baseos_latest
oracle-linux-manager-client-release-el8.x86_64   1.0-1.el8     ol8_baseos_latest
oracle-olcne-release-el8.x86_64                  1.0-6.el8     ol8_baseos_latest
oracle-ovirt-release-el8.x86_64                  1.0-1.0.3.el8 ol8_baseos_latest
oracle-release-el8.x86_64                        1.0-1.el8     ol8_baseos_latest
oracle-software-release-el8.x86_64               1.0-1.el8     ol8_baseos_latest
oracle-spacewalk-client-release-el8.x86_64       1.0-1.el8     ol8_baseos_latest
oraclelinux-automation-manager-release-el8.x86_64
                                                 1.0-1.el8     ol8_baseos_latest
oraclelinux-developer-release-el8.x86_64         1.0-7.el8     ol8_baseos_latest
oraclelinux-release-el8.x86_64                   1.0-24.el8    ol8_baseos_latest

Learn more about the Yum repository on Oracle Linux at https://yum.oracle.com/.

In addition to being able to download update packages, we recommend that you take a look at it as it contains a variety of information.

2.5. Check Oracle Linux specific packages

Some packages are only provided by Oracle Linux, but the default installation is basically the same. For your reference, here are the packages named oracle. We will leave out the details, but they are the parts that must be changed, such as the logos, licenses, repositories, GPG keys, etc.

# rpm -qa | grep oracle
oraclelinux-release-8.6-1.0.5.el8.x86_64
oraclelinux-release-el8-1.0-23.el8.x86_64
oracle-logos-84.5-1.0.1.el8.x86_64

3. Change the kernel to RHCK

For your reference, here’s how to change the default kernel UEK to RHCK. Use grubby for changes.

1. Check the default kernel. You can see that it is /boot/vmlinuz-5.4.17-2136.307.3.1.el8uek.x86_64 with index number “0”.

# grubby --default-index
0

# grubby --default-kernel
/boot/vmlinuz-5.4.17-2136.307.3.1.el8uek.x86_64

2. Next, it displays a list of the installed kernels. index = 1 is RHCK.

# grubby --info=ALL | grep -A 1 ^index
index=0
kernel="/boot/vmlinuz-5.4.17-2136.307.3.1.el8uek.x86_64"
--
index=1
kernel="/boot/vmlinuz-4.18.0-372.9.1.el8.x86_64"
--
index=2
kernel="/boot/vmlinuz-0-rescue-5b64998859b34f7884afea6dd27a9390"

3. Changes can be made by specifying the kernel path or by specifying the index number. You can use either, but you should specify the kernel path to prevent errors.

★Specify the kernel path
# grubby --set-default=/boot/vmlinuz-4.18.0-372.9.1.el8.x86_64
★Specify the index number
# grubby --set-default-index=1 

4. Ensure that the default kernel has been changed to RHCK.

# grubby --default-kernel
/boot/vmlinuz-4.18.0-372.9.1.el8.x86_64

5. Next, change the default kernel to an RH-compatible kernel using /etc/sysconfig/kernel. If you don’t fix this, you will return to UEK when you update yum.

/etc/sysconfig/kernel contents

# UPDATEDEFAULT specifies if kernel-install should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel
#DEFAULTKERNEL=kernel-uek ★Comment out and add the line above

You can change it manually, but you can also change it with the following command.

# sed -i -e 's/DEFAULTKERNEL=kernel-uek/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel

6. Restart to enable the modified kernel.

# shutdown -r

7. When you log in after rebooting, it has changed to an RH-compatible kernel. This completes the procedure.

# uname -r
4.18.0-372.9.1.el8.x86_64

4. Conclusion

In this article, we have focused on the differences between CentOS and RHEL. In fact, they are almost the same in normal use. If you are told that the installed environment is CentOS, you may not notice it.

However, even though the basic parts are the same as an RHEL-compatible distribution, Oracle Linux has a variety of peripheral tools for enterprises. It also has unique features like Ksplice that allow you to apply patches without rebooting. Now that CentOS has changed to CentOS Stream, Oracle Linux is one of the most trusted RHEL-compatible distributions. Why not give it a try?