Every time you download a RPM package for installation / updation via yum in Centos / Redhat system it gets deleted automatically after the procedure. Its a rather handy process by which your systems does not waste space storing the installation files.

Want to keep those packages in your system, and maybe create a local repository?

Well there are several ways. Simplest of them would be to edit the yum configuration file.

1
vim /etc/yum.conf.file

On the 2nd line,of the file, there you will find the cachedir variable ( eg :- cachedir=/root/packages/ ), one can set the location to which they want to store all these RPM packages.

but still you haven’t enabled the option to keep cache. To do so you should edit the 3rd line which has the variable keepcache, by default keepcache should be set to 0 ( keepcache= 0, which means disabled) change it to 1 to enable cache. This would enable storing of the RPM packages to the previously defined location.

For those who don’t want to store every single packages they download in to the cache, but want to keep a couple of the packages can use yum download only plugin.

1
yum install yum-downloadonly

After installing now you can download rpm packages to a sepcific directory without installing or updating the system.

1
yum update mplayer -y --downloadonly --downloaddir=/root/packages

Now about how to create a local repository I will write in my next post? Stay tuned. and Have fun.