Ubuntu 11.10 Proxy Settings

Temporary proxy:

Where proxy.addr is the proxy address, 4040 is the port number. Some proxies may require “http://” before the address.

export http_proxy="proxy.addr:4040"
export ftp_proxy="proxy.addr:4040"
export https_proxy="proxy.addr:4040"

If you run this in a terminal, any programs opened from that terminal will adhere to the proxy you set but any other applications will not. This makes it useful if you just want to launch a browser for a quick browsing session but don’t need the whole system to access the internet.

If you do need your entire system to access the network, you can add these to the bottom of “~/.bashrc” this will enable any new programs running and the whole system (after a restart) to use the settings. Essentially ~/.bashrc are commands run when a terminal is opened.

NOTE: If you do this, when you remove them your machine will likely need a restart to undo the changes.


Proxy with login

If your proxy server requires a login, this is an addition of the above however the syntax is as follows:

user:pass@proxy.addr:4040

APT Proxy:

APT (used for system updates) has its own proxy settings, which seem to ignore the above settings.

Where nano is the editor, if you prefer use a graphical one such as gedit, kedit etc.

sudo nano /etc/apt/apt.conf.d/02proxy

add:

Acquire::http::Proxy "http://proxy.addr:4040";

Source : http://naveenubuntu.blogspot.com/2011/09/updating-packages-behind-prxy-in-ubuntu.html

2 comments to Ubuntu 11.10 Proxy Settings

  • Anoop Malav

    This proxy setting has one minor error.
    Following is the correct :
    export http_proxy=”proxy.addr:4040″
    export ftp_proxy=”proxy.addr:4040″
    export https_proxy=”proxy.addr:4040″

    Without an equal-to(=) symbol it gives error.

  • You’re correct, I must have miss typed. I’ll fix it, thanks!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>