Saturday, April 3, 2010

Downloading RPM's using YUM

YUM now provides you with the ability to :
1. Download the RPM's without installing them.
2. Just get the list of URLs from where the RPM's would be downloaded.
3. Resolve the dependencies for the package that you plan to download, and get then too along with the package.
4. Get the source if you are intrested in that being more geeky.

And not just this much , yum will get you all this specific to your release and arch,so no more no-arch packages.

So here is how to go with this :
First of all you need to install the package 'yum-utils' as the utility that provides all this functionality using the configuration of YUM. Make sure that this all will work using the repos (software repositories both online and offline (if-any)) configured under /etc/yum.repos.d/ that are used by YUM for package searching, dependency resolution and many other packages related tasks. It all depends on the configuration in the repo files, using which yum will be looking up the packages in the stable and unstable repositories.

1. Download of RPM's
# yumdownloader firefox
The command will download the latest firefox from the closeset repository , into the PWD.
2. URL's of the RPM.
# yumdownloader --urls firefox
This will be listing the location [URL] of the RPM's, but will not download them, hence saving the bandwidth.
3. Installation of packages sometime need other packages for its installation known as 'Dependencies'. If these are missing the package will not install.
So in order to install all of the dependent packages we need to fire.
# yumdownloader --resolve firefox
If we only need to see the dependent packages without installing them, in that case the command need to be edited with
# yumdownloader --urls --resolve firefox
4. As listed above 'yumdownloader' just lists/ download the RPM's by default but incase if you want to get the source packages, we need to add the option '--source' to the query.
# yumdownloader --source firefox
In order to just get the URL's of the scource packages, the command need to be edited a bit.
# yumdownloader --urls --source firefox
And if one need the URL's of the scource packages along with the source of the dependencies, the command will look like.
# yumdownloader --urls --resolve --source firefox

Once you have the RPM's you can install them using different methods, either by 'rpm' command or by 'yum'.


Post a Comment