How would I use yum to update or install packages from a ISO of Red Hat Enterprise Linux version 5

Resolution:

In order to use yum to install or update packages from an iso file, follow the steps below: -

  1. Create directories to mount the iso file.


    #mkdir -p /cdrom/iso

  2. Mount the iso as loopback device.


    #mount -o loop /cdrom/iso

    Replace with the iso file.

  3. Create a repository. The createrepo package needs to be installed on the system in order to run the following commands. createrepo is an optional package and is not installed by default.


    #cd /cdrom
    #createrepo .
    #yum clean all

  4. Create a file /etc/yum.repos.d/file.repo as follows:


    #cat /etc/yum.repos.d/file.repo
    [RHEL 5 Repository]
    baseurl=file:///cdrom
    enabled=1

Running yum should now work with the iso file as the source.