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
  • 193,181
  • 53
  • 473
  • 722
  • 2
    possible duplicate of [syntax for SOCKS proxy in apt.conf](http://askubuntu.com/questions/35223/syntax-for-socks-proxy-in-apt-conf) – Panther Oct 07 '14 at 03:16
  • 4
    @bodhi.zazen if you notice, that is one of the questions I have linked to. I don't feel it answers my question as stated. If you do, please explain how. – muru Oct 07 '14 at 08:22
  • 1
    There are two options in the answers of that question. If you are having a problem you need to update your question and provide sufficient information for us to help you. We need information on your socks proxy (what proxy you are using), how the socks proxy is configured, and what you have done to configure apt. Did you even try tsocks ? Post your configuration files. Version of Ubuntu also helps. – Panther Oct 07 '14 at 12:59
  • 4
    @bodhi.zazen I am not using a socks proxy. I am not having a problem with socks. I am asking if apt supports SOCKS directly, and if it doesn't, does `Acquire::socks` have any meaning at all? Answers for any and all currently supported versions of Ubuntu are welcome. I am not going to try tsocks, because that's working around apt, not with it. There's nothing to more post. The question is self-contained, and please read a bit more carefully. – muru Oct 07 '14 at 13:10
  • 4
    I disagree with the close votes. This is the sort of question that needs to remain open, because somebody could come along any time in the future with a correction and at that time it would be useful for the community to have documentation that `Acquire::socks` _does_ exist, where there is a definitive record of it and where to find out more information about it. – Robie Basak Oct 09 '14 at 10:44

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,524
  • 4
  • 61
  • 86
  • 1
    Does DOT(.) at the end of first command is important? – αғsнιη Oct 09 '14 at 10:46
  • 1
    "If I've missed something..." - that's why I posted this question. If you set a SOCKS proxy using the network settings, and apply it system wide, an `Acquire::socks` line is added to `/etc/apt/apt/conf`. I was pretty sure I missed something. – muru Oct 09 '14 at 10:47
  • 3
    @KasiyA yes, he's grepping recursively through the current directory (`.`). Otherwise it will wait for input on stdin. – muru Oct 09 '14 at 10:48
  • 1
    This answer is not entirely correct anymore. The [source code](https://launchpad.net/ubuntu/+source/apt/1.6.2) of apt `1.6.2`, (which is part of Ubuntu 18.04) does have many occurrences of `socks` when you grep for that word via `grep -ir socks .` - therefore it seems there is at least some support for socks within `apt` now. – mkurz Jul 10 '18 at 19:45
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
  • 2