command wget not found even though it's already installed

21,442

wget is normally installed in /usr/bin, so try the full path:

/usr/bin/wget

if it's not installed there I presume you did a custom install, rather than

apt-get install wget

if it is there then somehow /usr/bin is missing from your path:

echo $PATH

so you'll have to add it.

Share:
21,442

Related videos on Youtube

Daniel
Author by

Daniel

Updated on September 18, 2022

Comments

  • Daniel
    Daniel over 1 year

    I have wget installed (version 1.17.1), but when i try to use it says:

    No command '​wget' found, did you mean:
     Command 'wget' from package 'wget' (main)
     Command 'owget' from package 'ow-shell' (universe)
     Command 'pwget' from package 'pwget' (universe)
    wget: command not found
    

    I'm pretty sure I'm missing something dumb here, but I can't figure it out. Help?

    edit: result of

     echo $PATH, type -a wget and stat /usr/bin/wget
    

    is:

    /home/danielgreenfeld/bin:/home/danielgreenfeld/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    
    wget is /usr/bin/wget
    
    File: '/usr/bin/wget'
    Size: 474656        Blocks: 928        IO Block: 4096   regular file
    Device: 808h/2056d  Inode: 6160959     Links: 1
    Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2016-11-01 16:38:14.860447561 +0200
    Modify: 2016-06-14 11:18:09.000000000 +0300
    Change: 2016-11-01 16:14:17.066538291 +0200
    Birth:
    
    ldd /usr/bin/wget:
        linux-vdso.so.1 =>  (0x00007ffd4ff9f000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f53fcbfd000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f53fc9f8000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f53fc78e000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f53fc34a000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f53fc130000)
    libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f53fbefc000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f53fbb33000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f53fb916000)
    /lib64/ld-linux-x86-64.so.2 (0x0000556638a4a000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f53fb711000)
    
    file -k /usr/bin/wget:
    /usr/bin/wget: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=34ad9f7e15210c48a07d185041d965f5681b8764, stripped\012- data
    
    getfacl /usr/bin/wget:
    getfacl: Removing leading '/' from absolute path names
    # file: usr/bin/wget
    # owner: root
    # group: root
    user::rwx
    group::r-x
    other::r-x
    
    • sinclair
      sinclair over 7 years
      How did you install it? Did you use apt-get install wget?
    • Daniel
      Daniel over 7 years
      yes, i used apt-get install. I edited and added the output
    • Daniel
      Daniel over 7 years
      oh sorry. I edited again
    • muru
      muru over 7 years
      I'm running out of ideas - all signs point to wget being executable and accessible from PATH. More details about your OS please? @Zanna thoughts?
    • Daniel
      Daniel over 7 years
      hmm, it's Ubuntu 16.04.1 LTS (I'm new to this so i'm not really sure what are the important details...)
    • Zanna
      Zanna over 7 years
      baffled @muru :( Daniel, does it work if you actually type the full path /usr/bin/wget http://thing/I/want/to/wget (replace with actual URL)? did you try closing the terminal and opening a new one after installing it? (although you shouldn't need to (and it should also be installed by default)). You're not using sudo are you? (it should work anyway because /usr/bin is in the secure_path too)
    • Daniel
      Daniel over 7 years
      when I type the full path i get "bash: /usr/bin/​wget: No such file or directory". I tried using a new terminal (and no sudo) but it didn't help :(
    • Daniel
      Daniel over 7 years
      Nothing else failed to run (at least nothing I'm aware of). I added those commands to the main post, but the last 2 commands report quite big messages. Should I add them too or something shorter?
    • Daniel
      Daniel over 7 years
    • Daniel
      Daniel over 7 years
    • muru
      muru over 7 years
      Huh. The strace output shows wget is executing fine. What about sh -c wget? bash -c wget?
    • Daniel
      Daniel over 7 years
      Hmm, they both result in "wget: missing URL Usage: wget [OPTION]... [URL]...". I tried to download a different file and it worked :0 is it possible that the problem is with the file i'm trying to download and not with wget after all?
    • Daniel
      Daniel over 7 years
      Solved! I copied the line "wget ..." and when i wrote it myself it somehow worked (I'm not sure what is this sorcery). Thank you so much for your help and time!
    • David Foerster
      David Foerster over 7 years
      @Daniel: You probably copied an "invisible" character (e. g. a non-breaking space) along with the command. That can happen easily on web sites.
  • slowko
    slowko over 7 years
    muru's comment added as I was posting!
  • Daniel
    Daniel over 7 years
    Actually, I did install it using apt-get :(