YUM is the package management tool that help to install or update the package through the network or local, the same time it provides easy method to install a package with it’s dependent packages. Configuration files are under /etc directory, /etc/yum.conf is the mail global file that contains the global options such as cache directory,log directory etc… To add new or update the existing repository, you must got to the /etc/repos.d directory and create or open a file that ends on .repo respectively.
First you must determine the name of the CD-ROM or DVD drive and there are 3 methods:
[a] dmesg Command
dmesg command is used to examine the Linux kernel ring buffer i.e. display bootup messages on screen. To find out if cdrom was detected or not, run:
bash# dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' ata2.00: ATAPI: VMware Virtual IDE CDROM Drive, 00000001, max UDMA/33 sr0: scsi3-mmc drive: 1x/1x writer dvd-ram cd/rw xa/form2 cdda tray
[b] /proc/sys/dev/cdrom/info file name.
bash# cat /proc/sys/dev/cdrom/info CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: sr0 drive speed: 1 drive # of slots: 1 Can close tray: 1 Can open tray: 1 Can lock tray: 1 Can change speed: 1 Can select disk: 0 Can read multisession: 1 Can read MCN: 1 Reports media changed: 1 Can play audio: 1 Can write CD-R: 1 Can write CD-RW: 1 Can read DVD: 1 Can write DVD-R: 1 Can write DVD-RAM: 1 Can read MRW: 1 Can write MRW: 1 Can write RAM: 1 bash#
[c] lsblk command
bash# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 558G 0 disk ├─sda1 8:1 1 307M 0 part /boot ├─sda2 8:2 1 250G 0 part /datasql ├─sda3 8:3 1 6G 0 part [SWAP] ├─sda4 8:4 1 1K 0 part └─sda5 8:5 1 301.7G 0 part / sr0 11:0 1 1024M 0 rom
Insert the Red Hat Enterprise Linux Server DVD into your DVD-ROM drive and mount the CD/DVD ROM on the any directory of your wish, for testing mount it on /mnt/cdrom.
bash# mkdir /mnt/cdrom bash# mount /dev/sr0 /mnt/cdrom
Create a new repository file.
bash# vi /etc/yum.repos.d/rhel-dvd.repo [dvd] name=DVD Repo baseurl=file:///mnt/cdrom enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Now you should be able to install from CDROM or DVD
bash# yum install <packages>