User Tools

Site Tools


Sidebar

linux:oel7_local_dvd_repo

Creating a Local Yum Repository Using an ISO Image

  • Transfer the removable storage to the system on which you want to create a local yum repository, and copy the DVD image (V921569-01.iso) to a directory (/media/V921569-01.iso) in a local file system. For transfer file can be used application WinSCP.
  • Create a suitable mount point, for example /mnt/OSimage/OL7.4_x86_64, and mount the DVD image on it.
# mkdir -p /mnt/OSimage/OL7.4_x86_64
# mount -o loop,ro /media/V921569-01.iso /mnt/OSimage/OL7.4_x86_64
  • Note
  • Include the read-only mount option (ro) to avoid changing the contents of the ISO by mistake.
  • Edit file /etc/fstab and add this row below,so that the system always mounts the DVD image after a reboot.
/media/V921569-01.iso /mnt/OSimage/OL7.4_x86_64 iso9660 loop,ro 0 0
  • Save and close file /etc/fstab
  • Create a new repository file containing these rows below (/etc/yum.repos.d/OL74.repo).
[OL74]
name=Oracle Linux 7.4 x86_64
baseurl=file:///mnt/OSimage/OL7.4_x86_64
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
gpgcheck=0 
enabled=1

Clean up the yum cache.

# yum clean all

Test that you can use yum to access the repository.

# yum repolist
Loaded plugins: refresh-packagekit, security
...
repo id                          repo name                                status
OL74                             Oracle Linux 7.4 x86_64                  25,459
repolist: 25,459
linux/oel7_local_dvd_repo.txt · Last modified: 2021/05/19 13:39 by admin