Install the program:
apt-get install apt-cache-ng
Edit /etc/apt-cacher-ng/acng.conf :
# Change to preferred storage location: CacheDir: /mnt/usbhd/apt-cacher-ng
If running apt-cacher-ng on Debian squeeze, edit file /etc/apt-cacher-ng/backends_ubuntu, set content to:
http://hk.archive.ubuntu.com/ubuntu/
Set APT to use cache by:
cat <<EOT > /etc/apt/apt.conf.d/90apt-cacher
Acquire::http {Proxy "http://192.168.0.1:3142";};
EOT
- Or -
Edit /etc/apt/sources.list :
deb http://192.168.0.1:3142/ftp.hk.debian.org/debian/ lenny main contrib non-free deb http://192.168.0.1:3142/security.debian.org/ lenny/updates main contrib deb http://192.168.0.1:3142/ftp.tw.debian.org/debian-volatile/ lenny/volatile main contrib non-free
Directory structure of the cache dir:
$ tree -d /mnt/usbdisk/apt-cacher-ng /mnt/usbdisk/apt-cacher-ng |-- debrep | |-- dists | | `-- lenny | | |-- contrib | | | `-- binary-i386 | | |-- main | | | `-- binary-i386 | | `-- non-free | | `-- binary-i386 | `-- pool | `-- main | |-- d | | `-- dialog | |-- l | | `-- live-helper | |-- libt | | `-- libterm-readline-gnu-perl | `-- t | `-- tree |-- security.debian.org | `-- dists | `-- lenny | `-- updates | |-- contrib | | `-- binary-i386 | `-- main | `-- binary-i386