auto-apt-proxy
Contents
About
man 1 auto-apt-proxy
Automatic detector of common APT proxy settings
auto-apt-proxy installs itself as an APT proxy autodetector, and detects common setups by checking some hosts on the local network for well-known APT proxies such as apt-cacher-ng.
This package is most useful for development environments, and will Do The Right Thing for at least these cases:
- Build chroots, with a proxy running on the host system.
- Docker/lxc containers, with a proxy running on the host system.
- Virtual machines with NAT networking, with a proxy running on the host system.
- Any other system, with a proxy running on its default gateway.
Systems where the apt-proxy hostname resolves to a valid IP address and a supported proxy is detected at that address.
The following APT proxy servers are supported and automatically detected:
- apt-cacher-ng
- approx
- apt-cacher
- squid-deb-proxy
any proxy advertised by an _apt_proxy._tcp SRV record in your DNS domain
any proxy advertised by an _apt_proxy._tcp SRV record in mDNS
needs avahi-tools [or avahi-utils to be installed, and avahi-daemon to be installed and running
This package has a minimal set of dependencies in order to minimize the influence on systems where it is installed. However, if neither iproute2 nor busybox are installed, functionality is severely limited.
Installation
Install auto-apt-proxy
1 aptitude install auto-apt-proxy
Enhance functionality
1 aptitude install iproute2 busybox
Enhance functionality with mDNS
1 aptitude install avahi-daemon avahi-utils
Usage
auto-apt-proxy respects some environment variables
AUTO_APT_PROXY_DEBUG
- If not empty, logs verbosely to STDERR
AUTO_APT_PROXY_NO_CACHE
- If not empty, does not cache its results (for 60 s)
to ${TMPDIR:-/tmp}/.auto-apt-proxy-${uid}
- Probably rarely used.
- If not empty, does not cache its results (for 60 s)
AUTO_APT_PROXY_AVAHI_NAME
If not empty, use hostname extracted from avahi (e.g. hostname.local)
- Probably rarely used.
TMPDIR
If not empty, use path as tmp-directory, else use /tmp
On invocation without arguments it just returns either the proxy URL or DIRECT to signal that no proxy has been detected.
/usr/bin/auto-apt-proxy
1 http://127.0.0.1:3142
On invocation with arguments these arguments are considered to be a command with args and the relevant environment variables are set.
Configure apt
The relevant configuration for apt is
/etc/apt/apt.conf.d/auto-apt-proxy.conf
apt-config dump | grep -i proxy
1 Acquire::http::Proxy-Auto-Detect "/usr/bin/auto-apt-proxy";