Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to add SOCKS proxy settings to /etc/apt/apt.conf. What is the syntax for it? Is it same as http and ftp syntax?

Thanks.

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

A possible solution can be to use tsocks, an application that can redirect the network traffic through a socks proxy. Install tsocks package, modify /etc/tsocks.conf to set address and port number of your socks proxy, and run:

$ sudo -s
# tsocks apt-get update
# tsocks apt-get dist-upgrade
# exit
$

or

$ sudo -s
# . tsocks -on
# apt-get update
# apt-get dist-upgrade
# . tsocks -off # not really necessary, given the exit
# exit
$

You can think to a number of options, to simplify and automate its use.
Don't forget the leading dot, the Manpage has more deatails on this.

Edit: a shorter way to use it:

$ sudo tsocks apt-get update
$ sudo tsocks apt-get dist-upgrade
share|improve this answer
    
thanks. will try that out! –  Ubuntuser Apr 15 '11 at 15:41
add comment

Or tou can put in your /etc/apt/apt.conf something like this:

Acquire::socks::proxy "socks://user:pass@host:port/";
share|improve this answer
1  
This doesn't seem to work in Ubuntu 12.04 –  Shnatsel Oct 16 '13 at 17:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.