How to Configure Ubuntu desktop to use your proxy server

Sponsored Link
If you are having ubuntu desktop/laptop in your office or home behind proxy this tutorial is for you.This tutorial will explain How to Configure Ubuntu desktop/laptop to use your proxy server.

Network Proxy

Ubuntu has a setting in gnome for the Network Proxy, which should set gnome’s proxy.

First go to System--->Preferences--->Network Proxy


Once it opens click on "Proxy Configuration" and enter your proxy server,port number details click Close.


Synaptic Package Manager

Synaptic Package Manager must have the proxy set, in order to update your installation using the in-built Update Manager or Synaptic GUI.

Go to System--->Administration--->Synaptic Package Manager


Once Synaptic Package Manager opens click on Settings--->Preferences


Click on Network tab select Manual Proxy Configuration option and enter your proxy server,port details.If you have username,password click on Authentication to enter these details click on ok


Firefox proxy Configuration

Open your firefox browser go to Edit--->Preferences


Click on Advanced and select Network tab


Select Settings option


Now select Manual Proxy Configuration and enter your proxy server,port details click on ok


Terminal Proxy

If you want to configure proxy for apt-get,aptitude,wget use the following procedure

First you need to edit /etc/bash.bashrc file

gksudo gedit /etc/bash.bashrc

Add your proxy server details in the following format

export http_proxy=http://username:password@proxyhost:port/
export ftp_proxy=http://username:password@proxyhost:port/

Save and exit the file

Update the source list and you can restart your system

sudo apt-get update

Sponsored Link

Incoming search terms:

Related posts

42 thoughts on “How to Configure Ubuntu desktop to use your proxy server

  1. You shouldn’t need to touch the Firefox settings. Just leave it at “use system settings” and it will use whatever you’ve set in the system proxy dialogue.

    Under Karmic/9.10 you won’t need to mess with the other settings either – just click “Apply system-wide” – no need to mess with exporting paths or fiddling with Synaptic.


  2. This is very helpful, in 9.10 I had to fiddle with Synaptic and exporting paths because my HTTP proxy requires user authentication and it comes up with an error if I just set the Network Proxy Preferences under the System Menu (even when set to system-wide).

    Yes, Firefox does use the Network Proxy Preference if set to System-Wide but only firefox asks you for your credentials, the others like Synaptic need you to configure it within their program


  3. What if you’re going to and from the office, you have to set and unset this in three places every time? Not good enough!


  4. @adam: you’d have to do that on windows if you used any non-microsoft programs (like firefox)

    The easiest way is to go multi-user and have different settings for each user, i’d imagine. then use homeuser at home and workuser at work.

    thanks for the article, it worked great, i think!


  5. I’ve followed the above instructions to configure my proxy at work and browsing the web only works partially.
    For example, hitting “login” for Yahoo mail gives me an error, same for Hotmail. Gmail does not display at all. Other websites work fine. What could be the problem? I tried putting my Active Directory user name and password for the proxy authentication credentials but that doesn’t seem to help much. I’m on an Active Directory network .


  6. Sounds like the proxy isn’t working for HTTPS sites. Make sure you ticked the “use this proxy server for all protocols” checkbox in the proxy config.


  7. This doesn’t work, nothing works, cannot do a commandline update getting 407 proxy Authentication errors, all websites same advice.


  8. This is about the 50th bit of advice I’ve followed to get my Ubuntu 9.10 to update — and it’s the 50th failure. No matter what I do, I keep getting IGN and 407 errors. I can get through with Firefox by simply setting the proxy and port, but Synaptic doesn’t work and neither does apt-get. I’m incredibly frustrated, and about to give up and reinstall XP.


  9. I have applied the settings system-wide but nothing can connect to the Internet except Thunderbird and Firefox.
    Skype, Pidgin, Update Manager … do not connect to the net! VERY frustrating!!!

    OpenSuse and Fedora both get through the proxy so I know it is not an issue with the server or with my username/password/settings!


    andrea Reply:

    I have the same.
    Firefox works fine but apt-get and the software centre would not connect


  10. I am also having difficulties in UNR 10.4. i enabled system-wide settings and applied to all protocols, but no program seems to pay any attention. Not any of my three web browsers, not the terminal (ssh, ping, etc), not my IRC client, nothing. Does it just not work?


  11. My broser works, my IM works, Synaptic works, but when i try to use apt-get. i get 407 error. I changed the bash file as mentioned here, but that didnt work for me. Tried to aply a system-wide on Network Proxy, but that doesnt seem to be working either.

    Dunno what else to do


  12. Just to let you know guys that i fixed my problem with apt-get by adding the proxy setup into apt.conf file. I found this here

    Hope it solves some of your problems.


    andrea Reply:

    link doesn’t work for me… do you have an alternate option or can you describe it here?


    Ricardo Reply:


    The info that was in this link is the same as in the terminal proxy in this topic, except that I had put it on the apt.conf file. Let me know if this does work for you.


    Andrea Reply:

    thank you.
    I eventually managed to make things work, except all conf files need editing, one for each command (apt, wget, etc).
    This is a bit annoying as i had hoped that applying the proxy system-wide from the proxy settings would suffice

    Ricardo Reply:

    Glad I could help.

    I’ve been away from linux for a while now, and I’ve never been and experienced user either, but I do share your concern.
    What I’ve been told is that some programs, for no reason I can tell, use their own proxy settings no matter what the system proxy settings are. That’s why these things happens. But that was in Ubuntu 8, or 9 (can´t remember).

  13. thank you for this information it SAVED my sanity
    after so many nights of trying to get my 10.04 to go on line.


  14. Also it might help to edit /etc/wgetrc . Uncomment the section for the proxy and add the required credentials for the proxy server.


  15. hi im having problem installing gui for ubuntu ive tried sudo apt get update and it doesnt work i keep getting err http…….hostname cannot be found what should i do? And I have a gui in my usb flash, its afterstep. how do i install from it?


  16. Hi – thanks for the tutorial first of all. It did not work for me, but I am just learning to use Computers and do not know much about them especially Linux. The tutorial makes complete sense, but my problem is really simple: How can I find out my Proxy-Setting or what exactly do I need? I went to one of these “How is my IP”Pages and it gave me the following information:

    IP Adress 146.23XXXXXXXXX
    Hostname bcproxyXXXXXXXX
    Remote Port 58509
    Protokoll HTTP/1.1
    eMule ID 84730XXXXXXXXXXX
    Proxy Proxy found
    Proxy IP 146.23XXXXXXXX
    Proxy Typ Anonymous Proxy
    Proxy Name b68044XXXXXXXXXXX

    I tried to connect using the Proxy IP and the Remote Port but that did not work. If I set Firefox to “automatically get settings” Internet works fine, but I would like to manually configure it to use the Updater, ect. My problem is that I do not know what exactly to put into the blank boxes (How do I find out what kind of proxy it is? Secure, HTTP, FTP?).

    Thanks alot in advance – I tried to search for an answer online but could not find anything better than this tutorial. The proxy is used here at a University in Africa if that is valuable information….



  17. Hello Nik.
    If the university owns this computer you are speaking of, then maybe you wont be able to change anything, for security reason.
    I think you should talk to the administrator of this network first, and check if they can give you the information about the proxy.




  18. It seems that network proxying is changed considerably in Oneric and generally found to be not working.

    Please update this instruction and/or provide an instruction to do this magical thing for Oneric.


  19. Setting up apt-get to use a http-proxy

    These are three methods of using apt-get with a http-proxy.

    Temporary proxy session

    This is a temporary method that you can manually use each time you want to use apt-get through a http-proxy. This method is useful if you only want to temporarily use a http-proxy.

    Enter this line in the terminal prior to using apt-get (substitute your details for yourproxyaddress and proxyport).

    export http_proxy=http://yourproxyaddress:proxyport

    APT configuration file method

    This method uses the apt.conf file which is found in your /etc/apt/ directory. This method is useful if you only want apt-get (and not other applications) to use a http-proxy permanently.

    IconsPage/info.png On some installations there will be no apt-conf file set up. This procedure will either edit an existing apt-conf file or create a new apt-conf file.

    gksudo gedit /etc/apt/apt.conf

    Add this line to your /etc/apt/apt.conf file (substitute your details for yourproxyaddress and proxyport).

    Acquire::http::Proxy “http://yourproxyaddress:proxyport”;

    Save the apt.conf file.

    BASH rc method

    This method adds a two lines to your .bashrc file in your $HOME directory. This method is useful if you would like apt-get and other applications for instance wget, to use a http-proxy.

    gedit ~/.bashrc

    Add these lines to the bottom of your ~/.bashrc file (substitute your details for yourproxyaddress and proxyport)

    export http_proxy

    Save the file. Close your terminal window and then open another terminal window or source the ~/.bashrc file:

    source ~/.bashrc

    Test your proxy with sudo apt-get update and whatever networking tool you desire. You can use firestarter or conky to see active connections.

    If you make a mistake and go back to edit the file again, you can close the terminal and reopen it or you can source ~/.bashrc as shown above.

    source ~/.bashrc

    How to login a proxy user

    If you need to login to the Proxy server this can be achieved in most cases by using the following layout in specifying the proxy address in http-proxy. (substitute your details for username, password, yourproxyaddress and proxyport)



  20. i am using Automatic proxy configuration url in my ubuntu 10.04 as mentioned in my college instructions. so i don’t know the port number. i am using ubuntu for the first time. how can i configure my ubuntu then. plz reply asap.


  21. i was new to ubuntu. i used this above mentioned procedure for my ubuntu 11.04. still my firefox or apt-get

    i checked apt-get by installing the package graphviz, here is the result

    saikirangvr@ubuntu:~$ sudo apt-get install graphviz
    [sudo] password for saikirangvr:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package graphviz is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘graphviz’ has no installation candidate

    can u please hjelp me……….


  22. here is the result after the next restart

    sudo apt-get update

    E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock directory /var/lib/apt/lists/

    what messed up?
    please help me……..


    ruchi Reply:

    Try this


    sai kiran Reply:

    it does not happen in mine as without my proxy configuration i cant install anything………..


    Niwantha Reply:

    Open terminal :

    Then past ;
    gksudo gedit /etc/apt/apt.conf

    then change to
    Acquire::http::Proxy “http://username:passward@yourproxyaddress:proxyport”;

    Acquire::http::Proxy “http://KSS:[email protected]:5232”;

    sudo apt-get update

Leave a comment

Your email address will not be published. Required fields are marked *