Enable local repo off the OS DVD iso

I have been working on adding a local repo so that yum can install the packages from local media before going out.
vi /etc/yum.repos/iso.repo

[MY-Local-ISO-repo]
baseurl=file:///mnt/repo
enabled=1

Note: Make sure label [MY-Local-ISO-repo] does not have any spaces.  Otherwise it will complain of ‘bad id for repo’


mkdir -p /mnt/repo/iso
mount -o loop linux_dvd_media.iso /mnt/repo/iso
yum clean all
cd /mnt/repo
createrepo .
find . --name "*GPG*"

then import the GPG keys. Here is an example

rpm --import /mnt/repo/iso/RPM-GPG-KEY-redhat-release
rpm --import /mnt/repo/iso/RPM-GPG-KEY-redhat-beta

That’s pretty much it.  Now you can use yum to install from locally.

Leave a comment

Your comment