侧边栏壁纸
博主头像
nivnek博主等级

道阻且长,行则将至

  • 累计撰写 21 篇文章
  • 累计创建 27 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

Ubuntu apt install via proxy

kenvin
2022-10-26 / 0 评论 / 3 点赞 / 862 阅读 / 1237 字

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?

3

评论区