Article title: use socks proxy in Linux command line. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In this magical country, we can't do without agents for a moment. Not only is it because you know it, but also because the IP address assigned to us is insufficient.
Because the environment variable http_proxy = "http: // proxy-ip: port" in Linux CL is used as the http proxy, I once thought that socks proxy also has an environment variable socks_proxy. It wasn't until recently that I found myself so stupid.
In Linux CL, the socks proxy is used. you can use the tsocks software. The official website is here: http://tsocks.sourceforge.net/but it has not been updated for a while. However, this software package is usually included in the source of the released version, which can be directly installed.
After the installation is complete, edit the/etc/tsocks. conf file. Make sure to modify the following four lines:
Local = 192.168.1.0/255.255.255.0 // no proxy is used locally
Server = 192.168.1.1 // proxy ip
Server_port = 1080 // port
Server_type = 5 // socks 4 or 5
After saving, use tsocks to start the program, for example:
Tsocks apt-get update