wget is working only when used with sudo

5,476

Solution 1

OK, problem solved.

It was in fact a bug with the gnome-terminal of Ubuntu 10.04.

I found my answer here.

In brief, just do a

sudo apt-get install gnome-terminal

Then close the terminal and launch it again! Such a simple solution for such a big problem!! :D

That's why you should always keep you Ubuntu updated :P (I didn't want to upgrade because I wanted to test some other things first, and the Internet connection is quite slow here; but I think I'd better do it now!!)

Solution 2

Connecting to 127.0.0.1:5865... connected. Proxy request sent, awaiting response... 200 OK

What does it mean?

Hint: compare env | grep -i proxy with sudo env | grep -i proxy

Share:
5,476

Related videos on Youtube

Yusuf
Author by

Yusuf

Updated on September 17, 2022

Comments

  • Yusuf
    Yusuf over 1 year

    I'm having quite a strange behavior with wget since yesterday.

    I can download files by using sudo wget, but when I try the same file with only wget, I can get this error:

    yusufh@ubuntu-yuh:~$ wget http://www.kegel.com/wine/winetricks
    --2010-12-17 09:34:11--  http://www.kegel.com/wine/winetricks
    Resolving www.kegel.com... failed: Name or service not known.
    wget: unable to resolve host address `www.kegel.com'
    

    and with sudo wget:

    yusufh@ubuntu-yuh:~$ sudo wget http://www.kegel.com/wine/winetricks
    --2010-12-17 09:35:37--  http://www.kegel.com/wine/winetricks
    Connecting to 127.0.0.1:5865... connected.
    Proxy request sent, awaiting response... 200 OK
    Length: 190672 (186K) [text/plain]
    Saving to: `winetricks'
    
    100%[==================================================================================================>] 190,672     --.-K/s   in 0.03s   
    
    2010-12-17 09:35:37 (6.92 MB/s) - `winetricks' saved [190672/190672]
    

    After the comments below, here is an update:

    I can use Google Chrome or Firefox perfectly without running it as root.

    I use ntlmaps to connect to the office proxy. So I need to use 127.0.0.1:5865 as the proxy for clients.

    Result for env | grep -i proxy:

    NO_PROXY=localhost,127.0.0.0/8,*.local,
    http_proxy=127.0.0.1:5865
    ftp_proxy=127.0.0.1:5865
    all_proxy=socks://127.0.0.1:5865/
    ALL_PROXY=socks://127.0.0.1:5865/
    https_proxy=127.0.0.1:5865
    no_proxy=localhost,127.0.0.0/8,*.local
    

    while sudo env | grep -i proxy is empty!

    HELP!

    • Michael Trausch
      Michael Trausch over 13 years
      Are other programs able to resolve DNS names without being root? If not, what are the permissions on the files used by the NSS (Name Service Switch) system, including /etc/hosts and /etc/resolv.conf?
    • Yusuf
      Yusuf over 13 years
      Yes, I'm able to use Google chrome; that's about the only program that uses Internet without root.
    • Yusuf
      Yusuf over 7 years
      Have you tried setting proxy for wget @TrevorSullivan ? Check this or this.
    • Trevor Sullivan
      Trevor Sullivan over 7 years
      @Yusuf Thanks -- I don't use a proxy though. It turned out to actually be a disk space issue, haha. Pretty straightforward.
  • benc
    benc over 13 years
    nice pickup. I missed that at first glance.
  • Yusuf
    Yusuf over 13 years
    I use ntlmaps to connect to the office proxy. So I need to use 127.0.0.1:5865 as the proxy for clients. env | grep -i proxy gives NO_PROXY=localhost,127.0.0.0/8,.local, http_proxy=127.0.0.1:5865 ftp_proxy=127.0.0.1:5865 all_proxy=socks://127.0.0.1:5865/ ALL_PROXY=socks://127.0.0.1:5865/ https_proxy=127.0.0.1:5865 no_proxy=localhost,127.0.0.0/8,.local, while sudo env | grep -i proxy is empty!
  • Yusuf
    Yusuf almost 10 years
    Be careful with newer versions of Ubuntu though, the /etc/resolv.conf file is overwritten on each restart. You can still add it through /etc/network/interfaces though.