Tuesday 26 February 2019

Use RHEL DVD as a Yum repository


Firstly, insert your DVD and mount it to /media/cdrom (or anywhere you would normally mount it and change the path in the code below)
To get yum use the RHEL DVD as a repository, add the file ‘rhel-dvd.repo’ in /etc/yum.repos.d with the following content:
1
2
3
4
[dvd]
name=Red Hat Enterprise Linux Installation DVD
enabled=0
The baseurl needs to point to the folder which contains the repodata folder. On the RHEL7 media this is directly in the mounted directory of the disc, in this case /media/cdrom so the file above should be adjusted accordingly.This will add a repository named ‘dvd’ and is disable it so that a normal 'yum' command won't read it by default. In order to use this repository, add ‘–enablerepo=dvd’ to your command for example. You can also add --nogpgcheck if you don't have the gpg keys installed and are unable to. This is a security feature that is there to prevent the downloading of malicious packages so should only be done when the installation source is trusted
 
1
# yum install --enablerepo=dvd --nogpgcheck packagename