Skip to content

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 http://dag.wieers.com/rpm/packages/createrepo/).

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 :

[rhel5_dvd]
name=DVD Redhat Enterprise Linux 5
baseurl=file:///media/cdrom/
enabled=1
gpgcheck=0