Wednesday 13 May 2009

apt-get behind proxy

THis topic have been discussed all around the web as well and there is numerious suggestions out there.

from the most popular is

  • to use Synaptic -> Administration and add your proxy details

  • download and install NTLMAPS manually, (Configure proxy in Konqueror then download and intall)

  • export http_proxy to the environmental settings


After some googling around I found this

Add the following to /etc/bash.bashrc
function myproxy(){
echo -n “username:”
read -e username
echo -n “password:”
read -es password
export http_proxy=”http://$username:$password@proxyserver:8080/”
export ftp_proxy=”http://$username:$password@proxyserver:8080/”
echo -e “\nProxy environment variable set to proxyserver:8080.”
}

Then whenever you want to set the proxy variable you just type “myproxy” at the command line.
When prompted for your proxyserver user name you type it in (you may need to type domain\\user if it’s a domain account) and then when prompted type your password (which isn’t echoed to the screen).

This will then set the environment variables, and they’ll be lost when you exit your session.
echo $http_proxy

can be used to show your proxy settings.

1 comment: