yum-downloadonly plugin to download from a YUM server without installing the RPM

I came across a great plugin today to solve the problem of needing to download an RPM from a YUM server without actually installing it.

My work environment is such that we have several different YUM servers that house various standard package RPM’s as well as custom rolled and shared service style RPM’s.  We also have a private staging YUM server that allows us to “qualify” packages before rolling them out to production.  This allows us to test RPM’s from a YUM Server and release them to production servers in a controlled fashion.

The issue then is what is the easiest way to get RPM’s from one YUM Server to another.  I stumbled across this YUM plugin called “yum-downloadonly” which allows you to download an RPM without actually installing it.  Let’s look at how the plugin works.

First you need to install “yum-downloadonly”

yum install yum-downloadonly

Next you run your command — but there are 2 flags in particular the we need to pass.  First is the “–downloadonly” flag to tell yum to download but not install the RPM.  Second is the flag “–downloaddir” which tells YUM the location where you would like to download the RPM file to.  In the following example I will download an RPM to the “/tmp” directory.

yum install my-rpm-name --downloadonly --downloaddir=/tmp

The desired RPM is now available in my “/tmp” directory ready for me to use as a file.

Posted in , , and tagged , .