APT-CACHER-NG

a Debian/Ubuntu package proxy

INSTALL

Ubuntu

apt install apt-cacher-ng
systemctl status apt-cacher-ng
cd /etc/apt-cacher-ng/

Slackware - look for latest and build it

wget http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/apt-cacher-ng_3.2.orig.tar.xz
tar xJf apt-cacher-ng_3.2.orig.tar.xz
cd apt-cacher-ng-3.2/
#grep -i wrap CMakeLists.txt
mkdir build
cd build
cmake ..
make -j5
make install
cd /usr/local/etc/apt-cacher-ng/

CONFIG

mv -i acng.conf acng.conf.dist
sed -r '/^[[:space:]]*(#|$)/d' acng.conf.dist > acng.conf

egrep '^CacheDir|^LogDir' acng.conf
mkdir -p /var/log/apt-cacher-ng/
mkdir -p /var/cache/apt-cacher-ng/

slackware w/ v3.2.orig w/o libwrap, fix empty Sourceforge mirror list and eventually HTTPS links to pass through

vi acng.conf

#Remap-sfnet:  file:sfnet_mirrors
UseWrap: 0
PassThroughPattern: .*

ACCEPTANCE

netstat -lntup | grep 3142

http://x.x.x.x:3142

OPERATIONS

tail -F /var/log/apt-cacher-ng/apt-cacher.{err,log}

start & enable

vi /etc/rc.local

echo -n cacherng...
/usr/local/sbin/apt-cacher-ng -c /usr/local/etc/apt-cacher-ng && echo done || echo FAILED

stop & status

pkill apt-cacher-ng
pgrep -a apt-cacher-ng

after a while

find /var/cache/apt-cacher-ng/
du -sh /var/cache/apt-cacher-ng/

CLIENT SETUP

nmap -p 3142 x.x.x.x
vi /etc/apt/apt.conf.d/02proxy

Acquire::http { Proxy "http://x.x.x.x:3142"; };

apt update

RESOURCES

Apt-Cacher NG https://www.unix-ag.uni-kl.de/~bloch/acng/

Setting up an ‘Apt-Cache’ Server Using ‘Apt-Cacher-NG’ in Ubuntu 14.04 Server https://www.tecmint.com/apt-cache-server-in-ubuntu/

riot-web repo does not work with apt-cacher-ng #3573 https://github.com/vector-im/riot-web/issues/3573


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml