1.9 Creating a Local Yum Repository Using an ISO Image


The system must have sufficient storage space to host a full Oracle Linux Media Pack DVD image (approximately 4.1 GB for Oracle Linux 7 Update 5).

To create a local yum repository (for example, if a system does not have Internet access):

  1. On a system with Internet access, download a full Oracle Linux DVD image from the Oracle Software Delivery Cloud at https://edelivery.oracle.com/linux onto removable storage (such as a USB memory stick). For example, V975367-01.iso contains the Oracle Linux 7 Update 5 Media Pack for x86 (64 bit).


    You can verify that the ISO was copied correctly by comparing its checksum with the digest value that is listed on edelivery.oracle.com, for example:

    # sha1sum V975367-01.iso
    4B08559B6176F701563C2E49553C89491C0F8F4E V975367-01.iso
  2. Transfer the removable storage to the system on which you want to create a local yum repository, and copy the DVD image to a directory in a local file system.

    # cp /media/USB_stick/V975367-01.iso /ISOs

  3. Create a suitable mount point, for example /var/OSimage/OL7.5_x86_64, and mount the DVD image on it.

    # mkdir -p /var/OSimage/OL7.5_x86_64
    # mount -o loop,ro /ISOs/V975367-01.iso /var/OSimage/OL7.5_x86_64

    Include the read-only mount option (ro) to avoid changing the contents of the ISO by mistake.

  4. Create an entry in /etc/fstab so that the system always mounts the DVD image after a reboot.

    /ISOs/V975367-01.iso /var/OSimage/OL7.5_x86_64 iso9660 loop,ro 0 0
  5. Disable all existing yum repositories.

    In the /etc/yum.repos.d directory, edit any existing repository files and disable all entries by setting enabled=0. If you have the yum-utils package installed, as described in Section 1.3.5, “Using Yum Utilities to Manage Configuration”, you can disable all repositories by running:

    # yum-config-manager --disable \*
  6. Create the following entries in a new repository file (for example, /etc/yum.repos.d/OL75.repo).

    name=Oracle Linux 7.5 x86_64

    Note that the correct GPG key file must exist at the path specified for the gpgkey parameter. You can download the GPG keys used to sign all of the Oracle Linux release packages from the Oracle Linux yum server. See https://yum.oracle.com/faq.html#a10 for more information.

  7. Clean up the yum cache.

    # yum clean all
  8. Test that you can use yum to access the repository.

    # yum repolist
    Loaded plugins: refresh-packagekit, security
    repo id                          repo name                                status
    OL75                             Oracle Linux 7.5 x86_64                  5,070
    repolist: 5,070