13 March 2012

Using YUM to install packages locally from DVD on CentOS

I was sitting in the train in India and didn't really have a sufficiently fast Internet connection available to me (nor did I want to pay the rather excessive 3g mobile Internet fees) that would enable me to download and install packages in my new CentOS installation.
I searched high and low for "local" installations from DVD media using yum, which automatically determines and installs dependencies (unlike RPM).
After looking at the yum man page, reading a few comments on the web and some experimentation I came up with the solution (for CentOS 5.6):

1. Insert DVD (in my case I was using an ISO image in VirtualBox)

2. Wait for media to be mounted and then issue (find the mount point - then make a specific /media/CentOS link):

mount (check output)
ln -s /media/CentOS_5.6_Final/ /media/CentOS

3. Now run yum to install packages, e.g. (disable all repo's but enable the CentOS 5 media):

yum --disablerepo=* --enablerepo=c5-media -y install compat-libstdc++-33

4. Afterwards eject DVD and remove link:

rm /media/CentOS

No comments: