How to install packages by apt-get via proxy? It was an issue in such cases that I needed to get packages via a proxy and no other ways would be possible.

To solve this issue, I’ve did some actions. First of all we to install tor .

Install Tor

$ apt-get install tor

Then make sure that Tor connected (100%) successfully:

$ tail -f /var/log/tor/log

Then we need to install privoxy.

Install Privoxy

$ apt-get install privoxy

Then config it:

Config Privoxy

Update these lines in /etc/privoxy/config:

listen-address loclhost:8118 to listen-address

Add these lines:

forward-socks4   /      .
forward-socks5   /      .

Now restart privoxy service:

$ /etc/init.d/privoxy restrat

Now it’s time to config apt-get command:

Apt-Get Command:

Create 01proxy file in /etc/apt/apt.conf.d/ with below settings:

Acquire::http::Proxy "";

Finally make sure that it works fine.

Test apt-get

$ apt-get update
All rights reserved ©