As a software tester I frequently need to install certain utilities when I’m testing Red Hat. For example on a clean install Red Hat I need to install NFS utilities.
Ideally I would just use Yum to install utilities but as I do not have a Red Hat portal subscription I need to get the required files from the installation DVD.
I can of course work out all the files required and install them one by one with uses way is to set up what we call a local repository so when I use Yum it goes to the DVD any stores are required files and their dependencies.
Create local.repo file
The first thing we need to do is to mount the CD-ROM or DVD, the main point is up to you but but for this example going to create a mount point of the root.
mount /dev/cdrom /cdrom
mount -t iso9660 /dev/cdrom /cdrom
The next stage is to create a local.repo file:-
Then add the following details
for Centos 7 use gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
After saving the file you just created we need to clear the cache by typing:-
yum clean all
That’s all there is to it, you can see that the repo file is already enabled and if you use Yum to install packages which are on the installation CD/DVD it will no point to the correct location.
Should you get a message when installing a rpm file to the effect that the rpm for is not signed. Change the value of gpgcheck to 0.
I have successfully managed to use the local repo for Red Hat 7.1, 7.2 and Centos 7.
Red Hat Linux 9 Bible
Red Hat Linux Administrator's Handbook (Administrator's handbooks)
Red Hat Linux Administration: A Beginner's Guide
Beginning Red Hat Linux 9 (Programmer to Programmer)
Linux Administration: A Beginner's Guide, Fifth Edition
Red Hat Linux 7 Unleashed
Linux Pocket Guide
Red Hat Enterprise Linux Troubleshooting Guide
Sams Teach Yourself Red Hat Linux 9 in 24 Hours
Learning Red Hat Linux