I just ran into this bug, and I think I've figured it out. /usr/share/squid-deb-proxy-client/apt-avahi-discover is outputting the URL of my squid-deb-proxy server, but it is also spitting out some errors: root@debian:~# /usr/share/squid-deb-proxy-client/apt-avahi-discover error: uncaptured python exception, closing channel ('192.168.2.232', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) error: uncaptured python exception, closing channel ('192.168.2.80', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) http://192.168.2.232:8000/] The problem here is that the errors are going to stdout, not to stderr. This means apt's Acquire::http::ProxyAutoDetect is not able to figure out what the proxy URL is. I have locally modified apt-avahi-discover so that the errors are sent to stderr, and I have verified that this allows apt's Acquire::http::ProxyAutoDetect to work correctly. I have attached this as a patch. This patch is enough to fix this bug, but I'm not sure it's ultimately the best fix for the overall issue. I think ideally, in the case were apt-avahi-discover encounters non-fatal errors (and is still able to produce a working URL), these error should probably just get logged to syslog, rather than being sent to stderr, because it does make apt's console output look rather ugly, and the user doesn't need to see any of that, because if there's a working URL, ultimately they don't care any other errors. (This is what apt's output looks like with the patch applied to apt-avahi-discover:) 0 upgraded, 826 newly installed, 0 to remove and 1 not upgraded. Need to get 500 MB of archives. After this operation, 1,554 MB of additional disk space will be used. Do you want to continue? [Y/n] 0% [Working]log: error: uncaptured python exception, closing channel ('192.168.2.80', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) log: error: uncaptured python exception, closing channel ('192.168.2.232', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) log: error: uncaptured python exception, closing channel ('192.168.2.80', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) log: error: uncaptured python exception, closing channel ('192.168.2.232', 3142): 9223372036854775807 (:[Errno 111] Connection refused [/usr/lib/python2.7/asyncore.py|read|83] [/usr/lib/python2.7/asyncore.py|handle_read_event|446] [/usr/lib/python2.7/asyncore.py|handle_connect_event|454]) Get:1 http://ftp.us.debian.org/debian/ jessie/main alsa-base all 1.0.27+1 [54.3 kB] Get:2 http://ftp.us.debian.org/debian/ jessie/main libcroco3 amd64 0.6.8-3+b1 [135 kB] Get:3 http://security.debian.org/ jessie/updates/main libvdpau1 amd64 0.8-3+deb8u1 [33.5 kB]