Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set Network Proxy to use my LAN's internet connection to update packages. while the proxy settings works on my firefox, but the package manager still cannot connect to Internet. I have set proxy in System >> Preferences >> Network Proxy and I have entered the user/pass for the proxy in 'Details' too.

How can I make sure that the Proxy Network is applied correctly?

share|improve this question
up vote 9 down vote accepted

First of all make sure you click on "Apply system-wide..." whenever you change proxy settings in the gnome-network-properties (System -> Preferences -> Network Proxy). This sets http_proxy and related environment variables. This should be available to all programs started after the proxy setting is "Applied system-wide...". To be really sure, you can logout and back-in to double-check this.

If you open a terminal and use the command set | grep -i proxy you would see the relevant environment variables set. Ideally this should be enough.

However, I have faced situations where all the above still doesn't work: Synaptic or apt-get (over commandline) can't connect to the internet through the proxy even after it is set in the above way. In such cases, one solution is to add a file in /etc/apt/apt.conf.d with specific proxy configuration for apt (this will be used by apt-get, aptitude, synaptic and Ubuntu software center).

Follow the below steps:

  1. Create /etc/apt/apt.conf.d/40proxy

    gksudo gedit /etc/apt/apt.conf.d/40proxy

  2. Put the following contents into it - modify the contents to suit your situation.

    Acquire::http::Proxy "";

If you have a user-name & password you could encode the same in the proxy url (like so, or you can use something like ntlmaps for better control.

More info could be found here.

share|improve this answer
thanks! first for introducing set. then as you predicted there were still problems with apt-get and update manager... and by creating 40proxy it solved. the only remained problem just root sees the proxy. e.g wget has different outputs with normal user and root. – Alexar Sep 12 '10 at 15:47
Can you elaborate your remaining problem ? For example, If you set proxy using System -> Preferences -> Network Proxy and Apply System-wide... then are you saying commands run as root user do not see this setting ? (Meaning sudo wget does not return proxy's IP address ?) – koushik Sep 12 '10 at 18:36
On another note, make sure you backup this 40proxy file (say, somewhere in your home folder), I have had this mysteriously disappearing. I think selecting Direct connection to Internet on Network Proxy dialog probably wipes this. It could be an issue with my system also, but not sure. – koushik Sep 12 '10 at 18:38

Have you clicked the Apply System Wide (highlighted) button? If you don't proxy settings are local to your Gnome session and therefore when root goes off to download packages, it won't use the same network settings.

Proxy settings

share|improve this answer
yes, i've done that. – Alexar Sep 8 '10 at 6:37

There's a bunch of good answers above that will help you if you're having problems (which is what your question implies). However, this is an answer to the narrow question of checking whether the Network proxy settings have been applied:

Method 1: Start a new shell (xterm), then check the environment variables:

% env | grep -i proxy

Note that existing shells will not have updated environment variables. So if you're executing a command that looks at environment variables for its proxy settings, start it in a shell created after the changes to the proxy settings.

Method 2: Use gconftool to query the gconf settings (which are stored under ~/.gconf):

% gconftool -R /system/proxy 
 old_ftp_port = 0
 old_ftp_host = 
 old_secure_port = 0
 old_secure_host = 
 autoconfig_url = 
 mode = manual
 ftp_host =
 secure_host =

% gconftool -R /system/http_proxy 
 use_authentication = false
 authentication_password = 
 authentication_user = 
 ignore_hosts = [localhost,,*.local,...]
 use_http_proxy = true
 port = 8080
 use_same_proxy = true
 host =

As others have noted, be sure that your browser and other apps are set to "Use System Proxy Settings".

share|improve this answer

To set a proxy temporarily you can fire up a terminal and enter

export http_proxy="http://yourproxy:yourport"

Then start the program, e.g. Synaptic for package management. The console might give you helpful output on what goes wrong.

share|improve this answer
To set the environment variable for one command only, you can also use: http_proxy="http://yourproxy:yourport" synaptic – hultqvist Mar 9 '11 at 7:45

If you try:


from the command line, then if you get HTML back the proxy is working.

share|improve this answer

I'm using a proxy also, and I had to set the proxy settings specifically for Synergy and update manager (using Synergy: Configuration->Preferences->Network). There's no option there to use the "system settings", and even if it should work, changing the proxy server at the system level never made me able to update :-(

I'm interested in a solution that make it work though :-)

share|improve this answer

Click on "Apply System-Wide..." and check that all your internet applications are set to use the system proxy. There's nothing more to it than this. There's no need to tamper with configuration files and start-up scripts.

share|improve this answer

anyone thought to check/add settings to:


try it with:

http_proxy="http://user:password@proxyserver:port" https_proxy="http://user:password@proxyserver:port" ftp_proxy="http://user:password@proxyserver:port"

share|improve this answer

Applying system-wide is not enough ! I think maybe ISA Server or maybe synaptic reset connection for each query to the web this issue that login and password authentication lie down. Or maybe ISA Server do not accept to transmit query that do not answer on HTTP protocol, but It's not my favorite.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.