Oracle Linux Repo Files
Oracle Linux 7 (Post January 2019)
From January 2019 the previous method of refreshing the Yum repositories has altered. The single large "public-yum-ol7.repo" file has been replaced by a number of smaller, more targetted files. You get these by installing the following package.
# yum install -y oracle-softwarecollection-release-el7
During the installation you will see the following message.
"IMPORTANT: A legacy Oracle Linux yum server repo file was found. Oracle Linux yum server repository configurations have changed which means public-yum-ol7.repo will no longer be updated. New repository configuration files have been installed but are disabled. To complete the transition, run this script as the root user:
/usr/bin/ol_yum_configure.sh
See https://yum.oracle.com/faq.html for more information."
The "/etc/yum.repos.d" directory originally just contained the "public-yum-ol7.repo" file, but now it has the following contents.
-rw-r--r--. 1 root root 46 Jan 26 09:42 .oracle_enable_repolist
-rw-r--r--. 1 root root 3354 Jan 26 09:42 oracle-linux-ol7.repo.disabled
-rw-r--r--. 1 root root 276 Jan 26 09:42 oracle-softwarecollection-ol7.repo.disabled
-rw-r--r--. 1 root root 8513 Jul 30 23:47 public-yum-ol7.repo
-rw-r--r--. 1 root root 2116 Jan 26 09:42 uek-ol7.repo.disabled
-rw-r--r--. 1 root root 226 Jan 15 21:31 virt-ol7.repo.disabled
Notice the new repository files with a ".disabled" extension.
So let's run the script as instructed.
# /usr/bin/ol_yum_configure.sh
This may install some additional packages to support other repositories, depending on what repositories you already had enabled before you started the process. Let's take a look at the contents of the "/etc/yum.repos.d" directory now.
-rw-r--r--. 1 root root 89 Jan 26 09:52 .oracle_enable_repolist
-rw-r--r--. 1 root root 243 Jan 26 09:52 oracle-epel-ol7.repo
-rw-r--r--. 1 root root 804 Jan 26 09:52 oraclelinux-developer-ol7.repo
-rw-r--r--. 1 root root 3354 Jan 26 09:42 oracle-linux-ol7.repo
-rw-r--r--. 1 root root 276 Jan 26 09:42 oracle-softwarecollection-ol7.repo
-rw-r--r--. 1 root root 8513 Jul 30 23:47 public-yum-ol7.repo.sav
-rw-r--r--. 1 root root 2116 Jan 26 09:42 uek-ol7.repo
-rw-r--r--. 1 root root 226 Jan 15 21:31 virt-ol7.repo
We can see the original "public-yum-ol7.repo" has been renamed to "public-yum-ol7.repo.sav", so it is no longer used. The new repositories, and some additional ones, have been renamed to remove the ".disabled" extension. These are now available for use.
If you check the contents of the new repo files, you should see all the repositories you originally had enabled are still enabled.
At this point it makes sense to try and update.
# yum update -y
That should work fine.
On one server I had an issue. I think the original repo file was old and confused the script. The solution to that problem was as follows.
Manually rename the files removing the ".disabled" extension.
Manually rename the olf file, adding the ".sav" extension.
Check each new repository file, enabling the required respositories.
Check the "/etc/yum/vars/ociregion". I believe it should be empty if you aren't running inside Oracle Cloud.
After you've done all this, you should be able to update successfully.