Creating a Local Yum Repository Using an ISO Image


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


  1. 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/V33411-01.iso /ISOs
  2. Create a suitable mount point, for example /var/OSimage/OL6.3_x86_64, and mount the DVD image on it.

    # mkdir -p /var/OSimage/OL6.3_x86_64  # mount -o loop,ro /ISOs/V33411-01.iso /var/OSimage/OL6.3_x86_64
    Note

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

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

    /ISOs/V33411-01.iso /var/OSimage/OL6.3_x86_64 iso9660 loop,ro 0 0
  4. In the /etc/yum.repos.d directory, edit the existing repository files, such as public-yum-ol6.repo or ULN-base.repo, and disable all entries by setting enabled=0.

  5. Create the following entries in a new repository file (for example, /etc/yum.repos.d/OL63.repo).

    [OL63]  name=Oracle Linux 6.3 x86_64  baseurl=file:///var/OSimage/OL6.3_x86_64  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY  gpgcheck=1   enabled=1 

  6. Clean up the yum cache.

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

    # yum repolist  Loaded plugins: refresh-packagekit, security  ...  repo id                          repo name                                status  OL63                             Oracle Linux 6.3 x86_64                  25,459  repolist: 25,459







Popular posts from this blog

Shrink you container size up to 95%.

alma linux: dnf Module yaml error: Unexpected key in data