Oracle linux 8 репозиторий установка

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.

Читайте также:  File opened by process in linux

Created: 2021-02-27 Updated: 2022-04-06

Источник

How to install Oracle Linux using public oracle repositories?

enter image description here

I’ve downloaded OL7.5 Boot ISO image and want to install the last version of Oracle Linux. Which address could I use to do it? NOTE: On the picture fields are inactive because of Network should be configured before.

In general people do network installs from sources on their own network, at LAN speed, and not over the internet- In other words : first download the installation sources and extract and copy their contents to a local web server or (NFS share) then use the address of that server — docs.oracle.com/cd/E52668_01/E54695/html/…

We do not have storage space for this additional purpose and do not need a lot of OL installations. Only minimal install is preferable and install ‘On the network’ using Internet source seems more appropriate for this purpose. Thank you!

3 Answers 3

To install specific version (for x86_64 platform):

Number 5 between OL7/ and /base could be replaced by any available update number.

OL7 repository site

Installation of the last update of OL7 (for x86_64 platform) will be:

Latest network installation source

After installation we have:

[root@localhost ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.7 (Maipo) 

Nice, but at next step in «Software Selection» left and right part are empty, cannot continue the installation. I tried «public-yum.oracle.com/repo/OracleLinux/OL8/UEKR6/x86_64»

@sekrett Have you tried installation from something like yum.oracle.com/ISOS/OracleLinux/OL8/u3/x86_64/… I haven’t used OL or similar distros a long time. Later I could try to reproduce your situation.

As of today, this content has changed and the above is not correct. But using pointers from Gryu’s answer above, I was able to find that the current URL for specifying at install time for base OS for current 8.3 is:

Читайте также:  Linux right to execute

Note the additional «baseos» inclusion. Also note that Oracle intentionally obfuscates these paths, as you cannot simply «navigate» to them via normal browser to confirm, so you need to poke around to find the appropriate path if it changes.

Источник

Оцените статью
Adblock
detector