So I went on to GNU/Linx community and put up this question. Okay I got some inputs some directions and finally I got what I wanted. First of all let me tell you the scenario once more so that you can better get what I want to say.
Suppose you have installed a RHEL5 system and now after the installation is complete you want to install a package (which is not installed). You put in the DVD and mount it. Go to the said directory and try to install the package via the well old “rpm” command. But to your surprise you found that it failed due to dependency problems. Okay no problem. We all know how to deal with it. We use the “–aid” switch with our “rpm” command that will automatically install the dependency rpm first then the said rpm. Well we try that but it again failed with the same error message. That means it’s not finding the dependency rpm. But wait. The dependency rpm and the rpm we want to install both are in the same directory then why is the “rpm” command failing.
Well that’s because in RHEL5 (as in Fedora Core 6) all the things are controlled by “yum”. I read somethings about “yum” and quickly found that it had problem with dvd sources. But I didn’t found any thing on how to disable “yum” completely and go through the well old command line way of installing packages. But I found a way out by which “yum” can access DVD sources and if that happens we can install/un-install packages easily either via graphical tool(system-config-packages) or the command line via “yum” command.
Okay so let’s start this.I inserted the RHEL5 Client DVD and mounted it on /media/dvd/
mkdir -p /media/dvd
mount /dev/dvd /media/dvd
Then I created a ISO file for this DVD using the “mkisofs” command.
mkisofs -o /opt/RHEL5.iso -r /media/dvd/
umount /media/dvd/
eject
mkdir -p /dvd/actual
mount -r -o loop -t iso9660 /opt/RHEL5.iso /dvd/actual
cd /dvd
rpm -Uvh actual/Client/creatrepo*
Now it’s time to create the repodata. This is how I did that (note: I didn’t changed my current directory. Was where I was previously).
createrepo .
/dvd/actual/Client, /dvd/actual/VT, /dvd/actual/Workstation
All got indexed and the metadata was created.
I also copied the GPG key files to my hard disk (to tell yum to use them later).
cp /dvd/actual/*GPG* /opt
Now finally came the time to tell yum to use this repo to for my installations. That was done by creating a repo file in /etc/yum.repos.d/. This is how it was done:
cd /etc/yum.repos.d/
vi dvd.repo
Inside this file I wrote the following:
[dvd]
name=RHEL5DVD
baseurl=file:///dvd
enabled=1
gpgcheck=1
gpgkey=file:///opt/RPM-GPG-KEY file:///opt/RPM-GPG-KEY-beta file:///opt/RPM-GPG-KEY-fedora file:///opt/RPM-GPG-KEY-fedora-test
Now finally I updated my “yum” so that it reads the new repo and other settings once again. For that I did:
yum clean all
yum update
Well I can use fstab for that.So I created a entry in /etc/fstab so that my ISO gets mounted automatically on boot.
Here was the entry I made in /etc/fstab:
/opt/RHEL5.iso /dvd/actual iso9660 defaults,ro,loop 0 0
For command line lovers “yum” command will work. Now they can search package via yum search
e installed Ubuntu 7.04 Herd 4. So now I have two Linux RHEL5 Beta2 (Client) and Ubuntu 7.04 Herd 4. Well I kept RHEL5 so that I can learn some more new things.