How to use Yum on Redhat Without A Portal Subscription

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.

mkdir /cdrom
mount /dev/cdrom /cdrom

or

mount -t iso9660 /dev/cdrom /cdrom

The next stage is to create a local.repo file:-

vi /etc/yum.repos.d/local.repo

Then add the following details

[LocalRepo]
name=Local Repository
baseurl=file:///cdrom
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

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.

Format:
Paperback
Pages:
384
Buy From Amazon:
Title:
Red Hat Linux 9 Bible
Format:
Paperback
Pages:
648
Buy From Amazon:
Title:
Red Hat Linux Administrator's Handbook (Administrator's handbooks)
Format:
Paperback
Pages:
544
Buy From Amazon:
Title:
Red Hat Linux Administration: A Beginner's Guide
Format:
Paperback
Pages:
600
Buy From Amazon:
Title:
Beginning Red Hat Linux 9 (Programmer to Programmer)
Format:
Paperback
Pages:
662
Buy From Amazon:
Title:
Linux Administration: A Beginner's Guide, Fifth Edition
Format:
Paperback
Pages:
1152
Buy From Amazon:
Title:
Red Hat Linux 7 Unleashed
Format:
Paperback
Pages:
272
Buy From Amazon:
Title:
Linux Pocket Guide
Format:
Paperback
Pages:
458
Buy From Amazon:
Title:
Red Hat Enterprise Linux Troubleshooting Guide
Format:
Paperback
Pages:
600
Buy From Amazon:
Title:
Sams Teach Yourself Red Hat Linux 9 in 24 Hours
Format:
Paperback
Pages:
336
Buy From Amazon:
Title:
Learning Red Hat Linux

Leave a Comment

1 × 3 =