LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   How to save downloaded packages CentOS software updater? (http://www.linuxquestions.org/questions/red-hat-31/how-to-save-downloaded-packages-centos-software-updater-884697/)

taylorkh 06-05-2011 02:48 PM

How to save downloaded packages CentOS software updater?
 
The subject line describes what I want to do. When I run the software updater in CentOS 5.6 it download, installs and then deletes the necessary packages. I would like to save the downloaded packages so I can copy them to another machine and save the download bandwidth. I know how to do this in Ubuntu by changing the Synaptic preferences. I have not found anything similar in CentOS. My searches have not found the answer either.

TIA,

Ken

colucix 06-05-2011 03:05 PM

Add the following lines to /etc/yum.conf inside the [main] section:
Code:

cachedir=/var/cache/yum
keepcache=1

and the trick is done. You will find the downloaded packages under /var/cache/yum into subdirs matching the names of the yum repositories.

T3RM1NVT0R 06-05-2011 03:09 PM

@ Reply
 
Hi there,

If I am not wrong when you run the yum updater it download the packages in /var/cache/yum , they should not get deleted until you run yum clean all. Next time you run yum updater check your /var/cache/yum directory and see if you have the downloaded package.

Here are the steps that you can follow to make a central server for yum repo:

1. Select one server to act as primary server (make sure that you use the same architecture on the other machine say 32 bit or 64 bit otherwise it will be of now use).
2. Run yum clean all, this will clear up the yum cache.
3. Run yum update or yum install and check if you see the package/packages under /var/cache/yum
4. If you do see packages then copy over the packages to some other location say /var/www/html/yum-packs
5. Run createrepo on the above location: createrepo /var/www/html/yum-packs
6. Then configure other system to use this system for yum updates.

I hope this helps.

taylorkh 06-05-2011 03:40 PM

Thanks folks for the quick replies!!! The packages are in deed to be found in /var/cache/yum/updates/packages. However, at the end of the update process they disappear. I edited the value of keepcache= in /etc/yum.conf and that did the trick.

I do not really need my own yum repo server. At most I may have a virtual machine and a physical machine running the same version. I can try things on the VM and if they work I may apply them to the physical machine. I simply copy the RPMs to the applicable yum/... directory then run the software updater or yum install and it finds the RMPs and does not bother to download them again.

Thanks again!

Ken


All times are GMT -5. The time now is 08:30 PM.