~~~~407 Proxy Authentication Required~~~~

浏览: 1805

Problem:

In Ubuntu 16.04, 

when try to update or download application in Terminal, 

the system periodically failed to  access the internet, 

came back with error '407 Proxy Authentication Required'. 

Solution:

全局:

For your apt-get to work, you should edit your apt config file:

sudo
-H gedit /etc/apt/apt.conf

And add Acquire::http::Proxy"http://username:password@proxyhost:port/";

The syntax shown above should be strictly followed.

This configuration may fail if your username or password has an '@' in it.You can also add proxy configuration for other protocols such as FTP.

Update:If your username or password has '@' in it you can replace it with%40 Example:If your password is @123 enter it as %40123.

for Git:

first

git config --global http.proxy http://username:password@proxiURL:proxiPort

then

git config --global http.sslVerify false

(I confirm it's necessary : if set to true getting "SSL certificate problem: unable to get local issuer certificate" error)

in my case, no need of defining all_proxy nor https_proxy variables

and finally

git clone https://github.com/someUser/someRepo.git






×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

一下基本没用,作为备份参考

Below is the solution quoted form Stack

Adding to /etc/apt/apt.conf/etc/apt/apt.conf.d/01proxy/etc/apt/apt.conf.d/01ubuntu:

Acquire::http::proxy "http://name:password@proxy_server:port";

export http_proxy=http://name:password@proxy_server:port/ on a terminal.

Adding export http_proxy=http://name:password@proxy_server:port/to /etc/bash.bashrc

推荐 1
本文由 Yuchi608 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

2 个评论

所处的环境和解决的实际问题写一下吧?
Yuchi608

Yuchi608 回复 seng

Thanks for comment, modified as suggested.
Hopefully it helps.

要回复文章请先登录注册