Skip to content

Instantly share code, notes, and snippets.

@nethunteros
Created March 12, 2017 15:51
Show Gist options
  • Save nethunteros/01d9cd173ed73c0eb214024ec8cc2c09 to your computer and use it in GitHub Desktop.
Save nethunteros/01d9cd173ed73c0eb214024ec8cc2c09 to your computer and use it in GitHub Desktop.
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