Using a Red Hat Enterprise Linux Installation DVD as a Software Repository
Using a Red Hat Enterprise Linux Installation DVD as a Software Repository
To use a Red Hat Enterprise Linux installation DVD as a software repository, either in the form of a physical disc, or in the form of an ISO image file.
-
If you are using a physical DVD, insert the disc into your computer.
-
If you are not already root, switch users to the
rootaccount:su - -
Create a mount point for the repository:
mkdir -p/path/to/repowhere/path/to/repois a location for the repository, for example,/mnt/repo -
Mount the DVD on the mount point that you just created. If you are using a physical disc, you need to know the device name of your DVD drive. You can find the names of any CD or DVD drives on your system with the command
cat /proc/sys/dev/cdrom/info. The first CD or DVD drive on the system is typically namedsr0. When you know the device name, mount the DVD:mount -r -t iso9660 /dev/device_name/path/to/repoFor example:mount -r -t iso9660 /dev/sr0 /mnt/repoIf you are using an ISO image file of a disc, mount the image file like this:mount -r -t iso9660 -o loop/path/to/image/file.iso/path/to/repoFor example:mount -r -o loop /home/root/Downloads/RHEL6-Server-i386-DVD.iso /mnt/repoNote that you can only mount an image file if the storage device that holds the image file is itself mounted. For example, if the image file is stored on a hard drive that it not mounted automatically when the system boots, you must mount the hard drive before you mount an image file stored on that hard drive. Consider a hard drive named/dev/sdbthat is not automatically mounted at boot time and which has an image file stored in a directory namedDownloadson its first partition:mkdir /mnt/tempmount /dev/sdb1 /mnt/tempmkdir /mnt/repomount -r -t iso9660 -o loop mount -r -o loop /mnt/temp/Downloads/RHEL6-Server-i386-DVD.iso /mnt/repoIf you are not sure whether a storage device is mounted, run themountcommand to obtain a list of current mounts. If you are not sure of the device name or partition number of a storage device, runfdisk -land try to identify it in the output. -
Create a new repo file in the
/etc/yum.repos.d/directory. The name of the file is not important, as long as it ends in.repo. For example,dvd.repois an obvious choice.-
Choose a name for the repo file and open it as a new file with the vi text editor. For example:
vi /etc/yum.repos.d/dvd.repo -
Press the I key to enter
insertmode. -
Supply the details of the repository. For example:
[dvd] baseurl=file:///mnt/repo/Server enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
The name of the repository is specified in square brackets — in this example,[dvd]. The name is not important, but you should choose something that is meaningful and recognizable.The line that specifies thebaseurlshould contain the path to the mount point that you created previously, suffixed with/Serverfor a Red Hat Enterprise Linux server installation DVD, or with/Clientfor a Red Hat Enterprise Linux client installation DVD. -
Press the Esc key to exit
insertmode. -
Type
:wqand press the Enter key to save the file and exit the vi text editor. -
After installing or upgrading software from the DVD, delete the repo file that you created.
-