apt-get临时设置代理

增加一个参数即可:-o Acquire::http::proxy="socks5h://127.0.0.1:1080/"

Acquire::http::proxy “http://127.0.0.1:1080/”
Acquire::ftp::proxy “ftp://127.0.0.1:1080/”
Acquire::https::proxy “https://127.0.0.1:1080/”
Acquire::http::proxy=“socks4h://127.0.0.1:1080/”

例如

sudo apt-get update

改写为:

sudo apt-get -o Acquire::http::proxy="socks5h://127.0.0.1:1080/" update
上一篇:线程锁


下一篇:JUC同步框架详解