I am using tsocks to socksify my connections. When I run the following commands, apt-get isn't socksified:
$ . tsocks -on
$ sudo apt-get update
However, when I run the whole thing in one line like the following, it works.
sudo tsocks apt-get update
I have verified that when I type . tsocks -on, my LD_PRELOAD environment variable is set to /usr/lib/libtsocks.so.
Why doesn't the former work?