How to use apt-get behind proxy server (Ubuntu/Debian)

mypapit debianIf you are a Debian-based GNU/Linux user, then you’re probably familiar with synaptic and apt-get to install application from software repositories. This post focussed on how to use apt-get/synaptic behind proxy server/firewall which under normal circumstances, you’re unable to use apt-get.

If you’re using Synaptic

Open up your Synaptic package manager (usually as root), go to Settings-> Preference -> Network. Enter your proxy server details like :, and put the proxy server port (usually 8080).

If you’re using command-line apt-get

Edit your /etc/bash.bashrc file as root.

Put these line at the end of your /etc/bash.bashrc file :

export http_proxy=
export ftp_proxy=http://username:password@proxyserver.netport/

You can omit the username:password, if your proxy server has no password. That’s all for today! Happy apt-get-ing!

debian,ubuntu,knoppix, mepis, apt-get



73 thoughts on “How to use apt-get behind proxy server (Ubuntu/Debian)

  • shailendra….try this,it sure should work..

    gedit /etc/apt/apt.conf

    then add these two lines

    Acquire::http::Proxy “http://username:password@proxy ip adress:8080/”;

    Acquire::ftp::Proxy “http://username:password@proxy ip adress:8080/”;

    where you input the following
    username = name of your wireless connection
    password = password of the wireless connection
    proxy ip address = ip address of your proxy server
    8080 = its the default proxy port,DONT CHANGE THAT!

  • Hii,

    My password have a special character.
    I have faced this problem.

    used this format [prabhakaran:1123@7@:80]

    –2011-09-13 18:18:41–
    Resolving 7″@… failed: Name or service not known.
    wget: unable to resolve host address `7″@’

    Help me pls

  • Hi,

    I have some problem with the password. My password already have ‘@’ character. So whenever I try to do an ap-get update after exporting the proxy it is showing the character after the @ symbol. For eg : I am giving export http_proxy=

    and during the update process it is returning Could not resolve ‘’

    How can I fix this other than changing the password..?

  • The notation that works is URL-encoding.
    So for this it means:


Comments are closed.