Command line
sudo apt -o Acquire::socks::proxy="socks5h://{your proxy_ip}:1080/" update
Write to config file
Add a new configuration file
vim /etc/apt/apt.conf.d/proxy.conf
Acquire::http::Proxy "socks5h://{your proxy ip}:1080";
Acquire::https::Proxy "socks5h://{your proxy ip}:1080";
Acquire::socks::Proxy "socks5h://{your proxy ip}:1080";
As the man page says, socks5h, not socks5, is supported by apt, which means socks5 proxy with DNS resolving ability
Refer:
[1] Configure proxy for APT?
评论区