ubuntu 系统的代理设置

安装了ubuntu的最新LTS版本 12.04, 需要重新下载android的源码,由于公司使用了代理服务器,在网络配置方面方面遭遇了各种问题,系统动不动就弹出407 Proxy Authentication Required,不厌其烦~

1.apt-get 设置代理

在目录/etc/apt中找到apt.conf文件,按照如下方式设置即可,例如用户名为sgj, 密码为shiguojun

Acquire::http::proxy "http://sgj:[email protected]:8080/";


2.repo 设置代理。


查了好半天,还是在google的说明里面找到了方法。


Troubleshooting network issues

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

HTTP_PROXY是设置http代理,HTTPS_PROXY是设置https代理。


等着repo sync成功即可了~
验证:sudo apt-get update

猜你喜欢

转载自weicaijin8.iteye.com/blog/2064527
今日推荐