Thursday, December 30, 2010

Getting apt-get and bzr to work behind a proxy

in /etc/bash.bashrc

append
export HTTP_PROXY=http://username:password@address:port/
          export HTTPS_PROXY=https://username:password@address:port/
export FTP_PROXY=http://username:password@address:port/

save it *(you prolly need superuser privilege(ie., sudo su) to edit bashrc).

and type apt-get update to see if you could retrieve a list of updates.

**** if it doesn't work try rebooting or input the below command ****
and then type the following command
user@prompt>source /etc/bash.bashrc
**** OR if it still doesn't work try rebooting or input the below command ****

sudo gedit /etc/apt/apt.conf
And add Acquire::http::Proxy "http://username:password@proxyhost:port/";

or you can perform the above in ~/.profile

As for pulling from GIT
since most corp(i think) would block GIT port(9418?), its best to relay everything through http port.
Under most circumstance, changing from git: to http: would do the trick.

OR

 export http_proxy=http://myproxy.domain.com:1234
$ git config --global http.proxy $http_proxy
## if you 
if you have $http_proxy set up as mentioned already.

No comments:

Post a Comment