We can pass apt-get connection through Tor Networks to keep our privacy. To do it, we need proxifying program called Torsocks to help any command line program to work through Tor socks proxy.

Install and Configure Tor

We've prepared a short tutorial about installing and configuring Tor in Ubuntu 14.04.

Install Torsocks

sudo apt-get install torsocks


Run Apt-Get 


Here the torsocks command syntax to run another command through Tor proxy:

torsocks [another_command [another_command_arguments]]

Here are some proxified/torified apt-get command examples:
sudo torsocks apt-get update
sudo torsocks apt-get install firefox
sudo torsocks apt-get upgrade
To run apt-get normally again (without Tor Networks), just remove “tsocks” from the command.

Verify Tor SOCKS Proxy Connection

To check whether it is true our connection being forwarded to Tor Networks or not, we can use tcpdump command (built-in inside Ubuntu).
sudo tcpdump -i wlan0 
sudo tcpdump -i eth0
sudo tcpdump -i ppp0
Select one command above according to your network connection interface i.e. wlan0 if you are connected to WLAN hotspot.

The output of tcpdump above probably is very confusing for beginner but you just need to see a Tor Networks' node (in our example, ds178-77-123-41.dedicated.hosteurope.de). You may check this node domain name in https://torstatus.blutmagie.de website (by Ctrl+F in that page). If there is, than your connection is truly connected to Tor Networks. See picture below.

, , , ,