Author Topic: How to install and configure apt-cacher-ng manually  (Read 3102 times)


  • Guru
  • ****
  • Posts: 361
    • View Profile
How to install and configure apt-cacher-ng manually
« on: August 25, 2009, 10:18:33 pm »

As you might have noticed there is now a apt cache functionality in our alpha to offload your internet connection when doing several updates.
Like when you update your core and later all MDs packages will only be downloaded once.
However it is not automatically installed unless you do a new installation.

For those of you that already have a working 0810 alpha alpha installed you can use this script.
The script below will install apt-cacher-ng on your core.
Then configure all your MDs to use the cache.

I have only tested my script once and it work on my core.

Code: [Select]

echo "installing apt-cacher-ng"
apt-get update
apt-get -y install apt-cacher-ng

echo "Configure your core to use apt-cacher-ng as apt proxy."
echo 'Acquire::http { Proxy "http://dcerouter:3142"; };' > /etc/apt/apt.conf.d/02proxy

echo "Configuring your MDs to use apt-cacher-ng proxy on dcerouter"
DIRLIST="$(ls -d /usr/pluto/diskless/*)"
for i in $DIRLIST; do
  if [ -e $FILE ]; then
    echo "Proxy config already exist in $FILE. Doing nothing!"
    echo "Copying 02proxy to MD located in $i."
    cp /etc/apt/apt.conf.d/02proxy $i/etc/apt/apt.conf.d/02proxy

Name it to and run it with "bash" or "./"