8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23ai | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Home » Articles » Linux » Here
Download the Latest Oracle Linux Repo File
Oracle are constantly amending the contents of their repository files, so it's a good idea to refresh the repo files from time to time to see the latest entries.
- Oracle Linux 7 (Post January 2019)
- Oracle Linux 7 (Pre January 2019)
- Oracle Linux 6
- Enabling/Disabling Repositories (yum-config-manager)
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.
Oracle Linux 7 (Pre January 2019)
For Oracle Linux 7 do the following. Remember, this is only relevant if you are doing this prior to January 2019.
cd /etc/yum.repos.d/ mv public-yum-ol7.repo public-yum-ol7.repo.old wget http://yum.oracle.com/public-yum-ol7.repo # Enable required repositories.
When you have the new repository file remember to flip the "enabled=1" flag for each required repository.
[ol7_optional_latest] name=Oracle Linux $releasever Optional Latest ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1
Oracle Linux 6
For Oracle Linux 6 do the following.
cd /etc/yum.repos.d/ mv public-yum-ol6.repo public-yum-ol6.repo.old wget http://yum.oracle.com/public-yum-ol6.repo # Enable required repositories.
When you have the new repository file remember to flip the "enabled=1" flag for each required repository.
[ol6_optional_latest] name=Oracle Linux $releasever Optional Latest ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/optional/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1
Enabling/Disabling Repositories (yum-config-manager)
The previous examples showed enabling repositories by manually flipping the "enabled" flag in the files. There is a way to do thing from the command line using the yum-config-manager
utility. To use this you need to install the yum-utils
package.
# yum install -y yum-utils
We can now enable or disable repositories using the yum-config-manager
utility. The repository name specified must match one of those in the repo files.
# yum-config-manager --enable ol7_developer_EPEL # yum-config-manager --disable ol7_developer_EPEL
This is useful for scripting and automation.
For more information see:
- Downloading the Oracle Linux Yum Server Repository Files
- Downloading the Oracle Linux Yum Server Repository Files
Hope this helps. Regards Tim...