Here is described how to publish APT client cache of your server as part of APT server storage on the same host.
Usage:
Consider following settings:
CACHE_DIR=/var/cache/apt/archives
STORAGE_DIR=/var/ftp/pub/apt
ARCH=ix86
REPO=cache
Step 1 (do once): create directories.
mkdir -p -m755 $STORAGE_DIR/$ARCH/{RPMS.$REPO,base}
Step 2 (at each boot in /etc/rc.d/rc.local
):
bind APT client cache directory to APT server repository directory.
mount -r --bind "$CACHE_DIR" "$STORAGE_DIR/$ARCH/RPMS.$REPO"
Step 2 (alternative, do once manually):
If your Linux kernel does not support «mount --bind
» option, you should move entire contents of$CACHE_DIR
to$STORAGE_DIR/$ARCH/RPMS.$REPO
, then create symbolic link$CACHE_DIR
pointing toRPMS.$REPO
.
Step 3 (periodically in /etc/cron.daily/apt-upgrade
):
update client cache and server repository.
apt-get update apt-get [-d] upgrade genbasedir --topdir=$STORAGE_DIR "$ARCH" "$REPO" [..other-repositories..]Remember, thatgenbasedir
should be called for all repositories at once, not separately for each repository!
Step 1 (do once):
put following line to /etc/apt/sources.list
rpm ftp://central.apt.farm/pub/apt ix86 cache [..more-repositories..]
Step 2 (periodically in /etc/cron.daily/apt-upgrade
):
install new packages from central APT farm
apt-get update apt-get upgrade
It's recommended to call apt-upgrade
on workstations
few minutes later after cron.daily
on central farm is finished.
Last changed at 23 May 2005 MSD 04:40
Have comments? Mail me.