Installing RPMs from your CDROM by adding it to yum.repos

Writing by on Friday, 10 of February , 2012 at 12:59 am

RHEL can be such a pain! I installed RHEL 6.1 and there was no gcc on there!?! Now for whatever reason I needed it and it wasn’t able to get yum install gcc to work. I’m not surprised at all – RHEL/CentOS are well known for being tortuous!

So now I needed to install the gcc* rpm from the CDROM and again I run into dependency hell. No big deal – it’s a well known RHEL problem.

Fortunately, I found Adding cdrom to yum as repo which partially rescued me. Next, I ran into Public key for kernel-headers-2.6.32-131.0.15.el6.x86_64.rpm is not installed and followed this link to get me going.

Step 1: Mount your CDROM to /mnt/cdrom
$ mount /dev/cdrom /mnt/cdrom (For Example)

Step 2: Add the CDROM to your yum.repos (Tell yum to look at the CDROM as well while installing packages)
$ vi /etc/yum.repos.d/file.repo

Step 3: Paste the following
name=Local CD Repo

Step 4: Tell yum to ignore any gpg key checking
$ vi /etc/yum.conf
Change gpgcheck=1 to gpgcheck=0

Step 5: Run the yum install and if found on the CDROM it’ll install it for you
$ yum install gcc (in my case)

Leave a comment

Category: Linux,Tips and Tricks

No Comments

No comments yet.

Leave a comment

You must be logged in to post a comment.

Shivdev Kalambi's Blog

Shivdev Kalambi is a Software Development Manager, previously a Principal Software Engineer at ArcSight/HP. With over 16 years' experience in software development, he's worked on several technologies and played different roles and contributed to all phases of projects. Non-tech activies include Ping-pong, Rock Climbing and Yoga at PG, Golf, Skiing, Swimming & a beer enthusiast.