- Create a Local Yum Repository for Oracle Linux 8
- Repository Creation
- Resync the Repository
- Setup the HTTP Server
- Point Servers to the Local Repository
- Oracle Linux 9
- MySQL 8.0 Connectors Community: x86_64, Source(x86_64), aarch64, Source(aarch64)
- MySQL 8.0 Tools Community: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Installation Media Packages
- BaseOS GA: x86_64, Source(x86_64), aarch64, Source(aarch64)
- BaseOS 9.1: x86_64, Source(x86_64), aarch64, Source(aarch64)
- BaseOS 9.2: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Packages for Test and Development
- Note: The contents in the following repositories are for development purposes only. Oracle suggests these not be used in production.
- EPEL Packages: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Developer Packages: x86_64, Source(x86_64), aarch64, Source(aarch64)
- KVM Utilities (Developer): x86_64, Source(x86_64), aarch64, Source(aarch64)
- BaseOS Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Appstream Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
- CodeReady Builder Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
- CodeReady Builder: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Distro Builder: x86_64, Source(x86_64), aarch64, Source(aarch64)
- Developer Preview of UEK Release 7 : x86_64, Source(x86_64), aarch64, Source(aarch64)
- Browse the repositories
- What’s New
- Oracle Linux 6
- Oracle Linux 7
- Oracle Linux 8
- Oracle Linux 9
- Oracle VM 3
- Getting Started
- Frequently Asked Questions
- Technical information
Create a Local Yum Repository for Oracle Linux 8
This article describes the process of setting up local Yum repositories for Oracle Linux using yum.oracle.com as the source repository. If you have a ULN subscription, you should use the method described here.
Thanks to Todd Vierling for the heads up about a bunch of changes regarding RHEL8/OL8.
Repository Creation
Install the following packages, which include the utilities necessary to set up the repository.
Create the following directories to hold the main OS and UEK respoitories.
# mkdir -p /u01/repo/OracleLinux # mkdir -p /u01/repo/logs # mkdir -p /u01/repo/scripts
If you’ve done a default installation of Oracle Linux 8, the «ol8_baseos_latest» and «ol8_appstream» repositories should already be enabled in the «/etc/yum.repos.d/oracle-linux-ol8.repo» file, and the «ol8_UEKR6» repository should already be enabled in the «/etc/yum.repos.d/uek-ol8.repo» file, but it’s worth checking before you continue.
The reposync command is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages.
# /usr/bin/reposync --newest-only --download-metadata --repoid=ol8_baseos_latest -p /u01/repo/OracleLinux # /usr/bin/reposync --newest-only --download-metadata --repoid=ol8_appstream -p /u01/repo/OracleLinux # /usr/bin/reposync --newest-only --download-metadata --repoid=ol8_UEKR6 -p /u01/repo/OracleLinux
It takes a long time to sync the repositories the first time, so be patient. Subsequent refreshes only bring across the changed packages, so they are much quicker. The «newest-only» option reduces the total size of the download.
Resync the Repository
A resync of the Yum repositories involves repeating the reposync command, so you should script them and run them from CRON. Create a script called «/u01/repo/scripts/repo_sync.sh» with the following contents.
#!/bin/bash LOG_FILE=/u01/repo/logs/repo_sync_$(date +%Y.%m.%d).log # Remove old logs find /u01/repo/logs/repo_sync* -mtime +5 -delete; >> $LOG_FILE 2>&1 # Sync repositories /usr/bin/reposync --newest-only --download-metadata --refresh --repoid=ol8_baseos_latest -p /u01/repo/OracleLinux >> $LOG_FILE 2>&1 /usr/bin/reposync --newest-only --download-metadata --refresh --repoid=ol8_appstream -p /u01/repo/OracleLinux >> $LOG_FILE 2>&1 /usr/bin/reposync --newest-only --download-metadata --refresh --repoid=ol8_UEKR6 -p /u01/repo/OracleLinux >> $LOG_FILE 2>&1
# chmod u+x /u01/repo/scripts/repo_sync.sh
Set up a CRON job to run the script on a daily basis. The following entry runs the script each day at 01:00.
0 1 * * * /u01/repo/scripts/repo_sync.sh > /dev/null 2>&1
Setup the HTTP Server
Install the Apache HTTP servers, start it and make sure it restarts automatically on reboot.
# dnf install -y httpd # systemctl start httpd # systemctl enable httpd
If you are using the Linux firewall you will need to punch a hole for port 80.
# firewall-cmd --permanent --zone=public --add-port=80/tcp # firewall-cmd --reload
# # One-off configuration. # dnf install -y policycoreutils-python-utils # semanage fcontext -a -t httpd_sys_content_t "/u01/repo/OracleLinux(/.*)?" # # Run each time the repo contents change. # restorecon -F -R -v /u01/repo/OracleLinux
Present the repositories using the HTTP server.
# mkdir -p /var/www/html/repo/OracleLinux/ol8_baseos_latest # ln -s /u01/repo/OracleLinux/ol8_baseos_latest/ /var/www/html/repo/OracleLinux/ol8_baseos_latest/x86_64 # mkdir -p /var/www/html/repo/OracleLinux/ol8_appstream # ln -s /u01/repo/OracleLinux/ol8_appstream/ /var/www/html/repo/OracleLinux/ol8_appstream/x86_64 # mkdir -p /var/www/html/repo/OracleLinux/ol8_UEKR6 # ln -s /u01/repo/OracleLinux/ol8_UEKR6/ /var/www/html/repo/OracleLinux/ol8_UEKR6/x86_64
Copy the GPG key to the HTTP server.
cp /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle /var/www/html/RPM-GPG-KEY-oracle-ol8
Point Servers to the Local Repository
To allow a server to use the local Yum repositories, create a file called «/etc/yum.repos.d/local-ol8.repo» with the following contents, where «ol8-yum.localdomain» is the name of the server with the Yum repositories.
[local_ol8_baseos_latest] name=Oracle Linux $releasever Latest ($basearch) baseurl=http://ol8-yum.localdomain/repo/OracleLinux/ol8_baseos_latest/$basearch/ gpgkey=http://ol8-yum.localdomain/RPM-GPG-KEY-oracle-ol8 gpgcheck=1 enabled=1 [local_ol8_appstream] name=Oracle Linux AppStream $releasever Latest ($basearch) baseurl=http://ol8-yum.localdomain/repo/OracleLinux/ol8_appstream/$basearch/ gpgkey=http://ol8-yum.localdomain/RPM-GPG-KEY-oracle-ol8 gpgcheck=1 enabled=1 [local_ol8_UEKR6] name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch) baseurl=http://ol8-yum.localdomain/repo/OracleLinux/ol8_UEKR6/$basearch/ gpgkey=http://ol8-yum.localdomain/RPM-GPG-KEY-oracle-ol8 gpgcheck=1 enabled=1
Hope this helps. Regards Tim.
Created: 2021-02-27 Updated: 2022-04-06
Oracle Linux 9
Latest MySQL 8.0 Community Server packages for Oracle Linux 9.
MySQL 8.0 Connectors Community: x86_64, Source(x86_64), aarch64, Source(aarch64)
MySQL 8.0 Tools Community: x86_64, Source(x86_64), aarch64, Source(aarch64)
Installation Media Packages
BaseOS GA: x86_64, Source(x86_64), aarch64, Source(aarch64)
BaseOS 9.1: x86_64, Source(x86_64), aarch64, Source(aarch64)
BaseOS 9.2: x86_64, Source(x86_64), aarch64, Source(aarch64)
Packages for Test and Development
Note: The contents in the following repositories are for development purposes only. Oracle suggests these not be used in production.
EPEL Packages: x86_64, Source(x86_64), aarch64, Source(aarch64)
Developer Packages: x86_64, Source(x86_64), aarch64, Source(aarch64)
KVM Utilities (Developer): x86_64, Source(x86_64), aarch64, Source(aarch64)
KVM Utils for test and development for Oracle Linux 9.
BaseOS Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
Appstream Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
CodeReady Builder Developer Preview: x86_64, Source(x86_64), aarch64, Source(aarch64)
CodeReady Builder: x86_64, Source(x86_64), aarch64, Source(aarch64)
Distro Builder: x86_64, Source(x86_64), aarch64, Source(aarch64)
Developer Preview of UEK Release 7 : x86_64, Source(x86_64), aarch64, Source(aarch64)
Developer Preview of UEK Release 7 for Oracle Linux 9 (not for production use).
Browse the repositories
What’s New
Oracle Linux 6
Oracle Linux 7
Oracle Linux 8
Oracle Linux 9
Oracle VM 3
Getting Started
The Oracle Linux Yum Server is pre-configured during installation of Oracle Linux 5 Update 7 or Oracle Linux 6 Update 3 or higher.
If you have an older version of Oracle Linux, you can manually configure your server to receive updates from the Oracle Linux yum server. Read more »
Frequently Asked Questions
Answers to the most frequently asked questions about Oracle Linux, Oracle Linux yum server, Oracle Linux Support and more. Read more »