7

The manpage for apt.conf doesn't mention SOCKS at all. Yet there are a few questions about SOCKS and apt here, and every now and then I see an answer which has something like:

Acquire::http::proxy ..
Acquire::https::proxy ..
Acquire::ftp::proxy ..
Acquire::socks::proxy ..

(all four) in them. Acquire::socks doesn't raise an error, but doesn't seem to have an effect either.

What exactly is the state of support for SOCKS proxies in apt?

muru
  • 207,228

2 Answers2

10

The apt source code has no mention of SOCKS whatsoever:

/tmp/apt-1.0.9.1ubuntu1$ grep -ir socks .
/tmp/apt-1.0.9.1ubuntu1$

It's also possible to have extension plugins for apt, such as apt-transport-https. These add files to /usr/lib/apt/methods/. So I used apt-file find to look for any other packages that provide files into this directory. This also did not reveal anything SOCKS related.

It's impossible to prove a negative, but I'd say that it's safe to say that apt itself has no SOCKS support right now. It looks like tsocks is the only real way forward.

I'm confused as to how others have concluded that Acquire::socks exists, but I can find no evidence of it. If I've missed something then I guess this answer is completely wrong (and I'll delete it).

Robie Basak
  • 15,910
0

I've just tested Acquire::http::proxy which works fine (or not if the proxy is down), but :socks: just goes directly to the net, skipping any (absent or not) proxy.

So it would seem it's impossible to use apt over socks, at least on Ubuntu 16.04.2.

Alex
  • 1