增加一个参数即可:-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