Configuring 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.

  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.
      sudo dnf config-manager --disable \*
    • Remove the .repo extension from the file names to cause yum operations to ignore these files.
      sudo bash -c "cd /etc/yum.repos.d; 
      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 10 client:

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

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

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

    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
    
    [local_ol8_ksplice]
    name=Ksplice for Oracle Linux 8  ($basearch)
    baseurl=http://local_mirror/repo-location/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
    gpgcheck=1
    enabled=1
    
    [local_ol8_userspace_ksplice]
    name=Ksplice-aware user space packages for Oracle Linux 8 ($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 clean metadata
    2. Verify that the relevant repositories are listed for the client.
      sudo dnf 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 update