ubuntu 系统的代理设置

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

1.apt-get设置代理

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

Acquire::http::proxy"http://sgj:shiguojun@10.0.2.254:8080/";

2.repo设置代理。

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

Troubleshootingnetworkissues

Whendownloadingfrombehindaproxy(whichiscommoninsomecorporateenvironments),itmightbenecessarytoexplicitlyspecifytheproxythatisthenusedbyrepo:

$exportHTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

$exportHTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

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

等着reposync成功即可了~

验证:sudoapt-getupdate

相关推荐