【发布时间】:2020-03-10 21:33:13
【问题描述】:
在 Ubuntu 14.04 中,为了通过公司代理在终端中使用某些命令(如 apt-get),我需要进行以下更改,超出系统设置 > 网络 > 网络代理 > “应用系统范围”(耻辱在你身上,Ubuntu)
/etc/environment (actually this is the only file modified by System Settings)
http_proxy="http://[webproxy]:[port]/"
https_proxy="https://[webproxy]:[port]/"
ftp_proxy="ftp://[webproxy]:[port]/"
socks_proxy="socks://[webproxy]:[port]/"
/etc/profile
export http_proxy=http://[username]:[password]@[webproxy]:[port]
export https_proxy=http://[username]:[password]@[webproxy]:[port]
export ftp_proxy=http://[username]:[password]@[webproxy]:[port]
sudo visudo
Defaults env_reset
Defaults env_keep = "http_proxy https_proxy ftp_proxy DISPLAY XAUTHORITY"
/etc/apt/apt.conf
Acquire::http::proxy "http://[username]:[password]@[webproxy]:[port]/";
Acquire::https::proxy "https://[username]:[password]@[webproxy]:[port]/";
Acquire::ftp::proxy "ftp://[username]:[password]@[webproxy]:[port]/";
Acquire::socks::proxy "socks://[username]:[password]@[webproxy]:[port]/";
or the same changes in
/etc/apt/apt.conf.d/95proxies
我认为至少以下命令(来自here)
sudo http_proxy='http://[username]:[password]@[webproxy]:[port]' apt-get update
应该可以吧?
这就是我现在记得的。甚至不确定它们是否真的有必要。不过,我在 Ubuntu 16.04 中进行了所有这些更改,但仍然无法使 sudo apt-get update 通过同一个代理(同一个房间的另一台计算机)工作。得到了
Temporary failure resolving '[webproxy]'
我错过了什么?
【问题讨论】:
标签: proxy apt-get ubuntu-16.04