2

I recently solved my problem How to check if Network Proxy is really applied? Now I can use sudo apt-get install application-name easily - but the problem is that the normal user (not the superuser) cannot see the proxy.

For example, these commands have different outputs:

wget http://whatismyip.com

and

sudo wget http://whatismyip.com

It shows that the first command does not use the proxy while the second clearly says:

Connecting to localhost|127.0.0.1|:8080... connected.

the strange thing is that when I check http://whatismyip.com with Firefox, it shows the proxy IP not my real IP, which means that Firefox sees the proxy.

Why can't wget see the proxy?

Alexar
  • 1,396

2 Answers2

2

Did you check that after doing Apply System-wide... that the following things happen :

  1. the file /etc/environment has entries with the proxy settings you specified.
  2. Any terminal program launched after closing the Network proxy dialog has the proxy variables set in their environment ?

    set | grep -i proxy
    

    should give you entries like this

    https_proxy = http://proxy.yoyodyne.com:18023/
    http_proxy = http://proxy.yoyodyne.com:18023/
    ftp_proxy = http://proxy.yoyodyne.com:18023/
    

wget as per the manual would use these proxies. I have it working at my laptop at work.

Are you sure, you have provided the wget command to a terminal process that was launched after the Network Proxy dialog was closed ?

koushik
  • 5,072
1

I think this may actually be bug 232469, which has some proposed fixes and workarounds. One of them seems to be to edit /etc/wgetrc as root, and scroll down to where you see this:

# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/

Uncomment (remove the #) and set the proxies you want to use. Save and close. This should set global wget-specific settings for all users, and should be an adequate workaround until the bug is resolved.

You can also add these settings to ~/.wgetrc and it will take effect on a per-user basis.

  • thanks for the note. i was made directly change proxy setting for apt-get too. so i should specify network proxy for each application separately. i think the Proxy Network is completely useless in Ubuntu. – Alexar Sep 15 '10 at 13:01
  • The Network Proxy app sets GNOME proxy settings, so yes, it only applies to applications which use them. – Jacob Peddicord Sep 15 '10 at 14:07
  • i don't like editing /etc/wgetrc/ as i would make to edit it again if i reinstalled ubuntu. is there any alternative file to edit in /home ? – Alexar Sep 24 '10 at 12:08
  • You can edit/create ~/.wgetrc and add the same settings, they will just only apply to your user and not root. Which should be fine for this situation. – Jacob Peddicord Sep 24 '10 at 14:13
  • In the bug report Jacob mentions, this comment and the next one are worth taking a look. – koushik Sep 24 '10 at 21:56