How to Configure Client Access to the Local Mirror

Clients require access to the local repository mirror to receive updates and errata fixes.

A local mirror must be configured where the clients connect. See previous sections in Using Software Distribution Mirrors.

Perform this task on all the clients in the local network. Use this same procedure to configure the local ULN mirror as a client of itself.

Note:

On Oracle Linux 8 and later clients, use the dnf command. On earlier clients, use the yum command.
  1. Import the GPG key.
    sudo gpg --import /etc/pki/rpm-gpg/RPM-GPG-KEY

    The location of the GPG key might differ depending on the Oracle Linux release that's installed on the system. You can also download and import the GPG keys directly from the Oracle Linux yum server. See https://yum.oracle.com/faq.html#a10 for more information.

  2. Disable any existing yum repositories configured in the /etc/yum.repos.d directory.

    Choose from one of the following methods:

    • Edit each /etc/yum.repos.d/*.repo file to specify an enabled=0 setting for each entry in the file.
    • Perform a global disable operation.
      cd /etc/yum.repos.d
      sudo dnf config-manager|yum-config-manager --disable \*
    • Remove the .repo extension from the file names to cause yum operations to ignore these files.
      /etc/yum.repos.d> sudo for i in *.repo; do mv $i $i.disabled; done
  3. Create a local *.repo file, such as /etc/yum.repos.d/local-yum.repo, and populate it with repository entries from the local mirror.

    Tip:

    To distinguish the local repositories from the public yum repositories or ULN channels, prefix the names of their entries with a string such as local_.

    The following example shows entries for an Oracle Linux 8 client:

    [local_ol8_baseos_latest]
    name=Oracle Linux 8 BaseOS Latest ($basearch)
    baseurl=http://local_mirror/repo-location/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
    gpgcheck=1
    enabled=1
    
    [local_ol8_appstream]
    name=Oracle Linux 8 Application Stream ($basearch)
    baseurl=http://local_mirror/repo-location/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
    gpgcheck=1
    enabled=1
    
    [local_ol8_addons]
    name=Oracle Linux 8 Addons ($basearch)
    baseurl=http://local_mirror/repo-location/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
    gpgcheck=1
    enabled=1
    

    For local_mirror, you can specify either the local server's resolvable host name or its IP address.

    Ensure that the following configurations are correct:

    • All the entries have an enabled=1 setting.
    • The baseurl points to the correct mirror location that contains the repositories that each client requires. The locations depend on how you organized the repositories in the mirror's base directory, such as /var/www/html/yum.
    • The correct GPG key file must exist at the path that's specified for the gpgkey parameter. You can download the GPG keys used to sign all the Oracle Linux release packages from the Oracle Linux yum server. See https://yum.oracle.com/faq.html#a10 for more information.
  4. Test the configuration.
    1. Clear the yum metadata cache.
      sudo dnf|yum clean metadata
    2. Verify that the relevant repositories are listed for the client.
      sudo dnf|yum repolist

      If the client can not connect to the local yum server, check that the firewall settings on the local yum server enable incoming TCP connections to the HTTP port, which is typically port 80.

  5. After confirming that the correct repositories are configured on the client, obtain updates from the local server.
    sudo dnf|yum update