Re: auto-creating a local yum cache?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




Am 12.12.2011 21:49, schrieb Alan McKay:
> Hey folks,
> 
> I just did an update on a system that is taking the better part of a day (
> 5.3 ---> 5.7 ) mainly due to file download times.
> 
> And I have 4 or 5 more systems to do.
> 
> I know I can create my own repository and then point them at it - but that
> is difficult here because rsync is blocked (ggrrrrrr...)
> 
> Surely there must be a way to have yum on the first box automatically cache
> everything and then have the other boxes use the cache?   Maybe if not
> directly, then with squid or something like that?
> 
> Anyone happen to have done this before?

i am using this script since years to have running one build/update-server
caching all packages in a local-repo and all other machines in the network
have only the via http exported cache-repo active

this machine must have all packages used in the whole network installed
this si for fedora, but CentOS should not be the big difference

1. you save bandwith / time
2. you can be sure that all machines having the same package-versions

[root@buildserver:~]$ cat /buildserver/repo-cache.sh
#!/bin/bash
basearch=`uname -i`
releasever=`rpm -q --qf "%{version}\n" fedora-release`
# Alle Subfolder unter "/var/cache/yum" durchlaufen und RPM-Pakete
# in das eigene Repo kopieren
for g in `ls -1b /var/cache/yum`
do
 if [ -d /var/cache/yum/$g/packages ]
 then
  echo "/var/cache/yum/$g/packages/ > /repo/cache/fc$releasever/"
  sudo cp --verbose /var/cache/yum/$g/packages/*.rpm /repo/cache/fc$releasever/ 2> /dev/null
 fi
done
sudo createrepo -d /repo/cache/fc$releasever/
sudo chown -R builduser:builduser /repo/cache/fc$releasever/
sudo chmod -R 755 /repo/cache/fc$releasever/

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux