Create a repository via the CD/DVD or ISO on Redhat based systems

--Mounting the CD/DVD-- 
#mount -t iso9660 /dev/cdrom /media/cdrom (adapt this to your environement)

--Mounting the ISO image-- 
#mount -o loop /path/to/file.iso  /path/to/isodest (adapt this to your environement)

-- Using the command 'createrepo' to create the repository --
Note : You will need to download the package 'createrepo' in order to be able to create the repository (look at

Change to directory where you can list the content of the DVD :
#cd /media/cdrom
#createrepo .  (it should take some time)
#yum clean all 

--Create a new .repo file--
#cd /etc/yum.repo.d/
In this directory using your prefered text editor create a new file .repo :
#vim rhel5_dvd.repo
And the file should look like this :

name=DVD Redhat Enterprise Linux 5

You may also like