Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apt-cacher-ng setup server
#!/bin/sh
# Install apt-cacher-ng
apt-get install -y apt-cacher-ng
# This will be a caching server on local network. Change IP to private or leave listening
echo "BindAddress: 0.0.0.0" >> /etc/apt-cacher-ng/acng.conf
echo "Port:3142" >> /etc/apt-cacher-ng/acng.conf
echo "PidFile: /var/run/apt-cacher-ng/pid" >> /etc/apt-cacher-ng/acng.conf
# Enable apt-cache to use itself as proxy
echo 'Acquire::http { Proxy "http://127.0.0.1:3142"; };' > /etc/apt/apt.conf.d/50apt-cacher
# On client machines point to proxy server by modifying settings:
# echo 'Acquire::http {Proxy "http://[ip of apt-cache proxy server]:3142";}' > /etc/apt/apt.conf.d/30proxy;
# Restart service and enable at boot
/etc/init.d/apt-cacher-ng restart
systemctl enable apt-cacher-ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.