Publish packages from client cache via network

Here is described how to publish APT client cache of your server as part of APT server storage on the same host.

Usage:

Configure central APT farm

Consider following settings:

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 to RPMS.$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, that genbasedir should be called for all repositories at once, not separately for each repository!

Configure workstations

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

Common note

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.

Хостинг от uCoz