Monday, February 8, 2016

RHEL: Add DVD to YUM repository

Insert the Red Hat Enterprise Linux Server DVD into your DVD-ROM drive and mount it under /media/. In my case, the DVD was automounted under/media/RHEL_5.7 x86_64 DVD/. Then, as root, create a new file in the yum repository directory:
# vim /etc/yum.repos.d/rhel-dvd.repo
This file contains the metadata of the repository. I found a template here (check that link if you need more information about the parameters) and adapted it to fit my needs:
[rhel-dvd]
name=Red Hat Enterprise Linux $releasever - $basearch - DVD
baseurl=file:///media/RHEL_5.7%20x86_64%20DVD/Server/
enabled=1
gpgcheck=1
gpgkey=file:///media/RHEL_5.7%20x86_64%20DVD/RPM-GPG-KEY-redhat-release
Save and close the file. Done! Now we can use yum to install new packages and resolve dependencies. If you want to remove the DVD from the yum sources, simply change enabled=1 to enabled=0

No comments: