Skip to content
Home » DB_CREATE_ONLINE_LOG_DEST_2 » How to Setup Oracle Yum Repository for RHEL 8

How to Setup Oracle Yum Repository for RHEL 8

Here are steps to install Oracle Linux 8 yum repository into Red Hat Enterprise Linux (RHEL) derivative or Fedora, in this case, it's AlmaLinux 8.

For RHEL 7 and its derivatives, you may refer to the post: How to Setup Oracle Linux 7 Yum Repository.

Edit Oracle Linux 8 Yum Repository

Here we edit a temporarily used yum repository for further operation.

[root@test ~]# cd /etc/yum.repos.d/
[root@test yum.repos.d]# vi public-yum-ol8.repo
[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

The repository is enabled.

Download Oracle Linux 8 GPG Key

To prevent GPG key retrieval failed, we need to download the right GPG key for the above Oracle yum repository.

[root@test yum.repos.d]# wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Let's see what we have now.

[root@test yum.repos.d]# ll /etc/pki/rpm-gpg/
total 8
-rw-r--r--. 1 root root 3494 Nov 19 11:44 RPM-GPG-KEY-AlmaLinux
-rw-r--r--. 1 root root 3169 Jul 23  2019 RPM-GPG-KEY-oracle

RPM-GPG-KEY-oracle has been downloaded at the right place.

Please note that, the target filename has been changed and different from the source.

Install Newest Oracle Linux 8 Public Yum Repository

To install the newest Oracle Software yum repository, we use command dnf to install oraclelinux-release-el8.

[root@test yum.repos.d]# dnf -y install oraclelinux-release-el8

Here we leave an informative release version for this OS.

[root@test yum.repos.d]# echo "Oracle Linux Server release 8.7" > /etc/oracle-release

Remove Old Repository

Since the temporary repo file is no longer used, we can make it step aside.

[root@test yum.repos.d]# mv public-yum-ol8.repo public-yum-ol8.repo.disabled

Optionally, we can remove old repositories and see what we have now.

[root@test yum.repos.d]# rm -f ./almalinux-*
[root@test yum.repos.d]# ll
total 16
-rw-r--r--. 1 root root 3660 Nov  9 00:55 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  214 Jan 29 21:01 public-yum-ol8.repo.disabled
-rw-r--r--. 1 root root  941 Nov 10 10:43 uek-ol8.repo
-rw-r--r--. 1 root root  243 Nov 10 10:43 virt-ol8.repo

Test New Repositories

Let's check some Oracle proprietary package. For example, oracle-database-preinstall-19c which facilitates us to prepare required packages for an Oracle database 19c environment.

[root@test yum.repos.d]# dnf info oracle-database-preinstall-19c
Available Packages
Name         : oracle-database-preinstall-19c
Version      : 1.0
Release      : 2.el8
Architecture : src
Size         : 32 k
Source       : None
Repository   : ol8_appstream
Summary      : Oracle Database Preinstallation RPM
License      : GPLv2
Description  : The Oracle Database Preinstallation RPM automatically installs
             : any additional packages needed for installing Oracle Grid
             : Infrastructure and Oracle Database and configures your server
             : operating system automatically, including setting kernel
             : parameters and other basic operating system requirements for
             : install.

Name         : oracle-database-preinstall-19c
Version      : 1.0
Release      : 2.el8
Architecture : x86_64
Size         : 31 k
Source       : oracle-database-preinstall-19c-1.0-2.el8.src.rpm
Repository   : ol8_appstream
Summary      : Oracle Database Preinstallation RPM
License      : GPLv2
Description  : The Oracle Database Preinstallation RPM automatically installs
             : any additional packages needed for installing Oracle Grid
             : Infrastructure and Oracle Database and configures your server
             : operating system automatically, including setting kernel
             : parameters and other basic operating system requirements for
             : install.

Done! We have switched the software repositories from RHEL8 to OL8. Now we can take the advantage to prepare required packages for Oracle database 19c.

4 thoughts on “How to Setup Oracle Yum Repository for RHEL 8”

Leave a Reply

Your email address will not be published. Required fields are marked *