Friday, August 17, 2007

Downloading rpm packages using yum - part II

Once you have done the steps mentioned in my previous post then you are one step ahead of collecting all the packages you need to install the application on some other system.

But the problem is the sub-folders under the cachedir will contain previously download packages too and you have to manually separate out those downloaded in the previous yum install or update which is very tedious. I wrote a shell script to do just the job we need but it is not modeled to handle error conditions, so here are the steps you need to follow,
  1. first of all it is used to install a package and not update, if you want to update a package and get all this done from the script then you need to change the command in script from "yum install $1" to "yum update $1".
  2. say you want to download the xchm viewer for your system
  3. you first type the command "yum install xchm"
  4. it will search for dependencies and take you to a prompt saying you want to download it or not, say no. If you get any other response from yum like saying "Nothing to do" then don't proceed any further.
  5. now execute the script with xchm as the argument, i.e. "./yum.sh xchm". It won't ask you this time if you want to download the packages or not.
  6. It will create a tar ball of all the packages downloaded and will place it in your home directory.
It is a very simple, unsophisticated maybe inefficient script but I don't think we will be using it for mission critical purposes :) . Download the script here.

PS: Remember this always, it is need which drives innovation.

3 comments:

Kartoon said...

"Yummy script!" :)
now you are turning into a real novellite ;)

Anonymous said...

Hi anandh :)
I'm Ajay from IIITM Kerala. Recently I got selected for the Sun CA program. I want help from you. Can u send ur email id so that i can contact you. Or add my gmail id ajay.iiitmk@gmail.com so that we can chat.

Thanks.

Anonymous said...

Thanks for this.

saved a lot of time for me. Keep up the good work

Ravi K London, formally from Chennai & Jaffna