How to Fix “wget: command not found” in Linux

“wget” is a command-line application in Linux that is used to download files from the internet. It is often used for downloading big files, downloading entire directories recursively, and downloading data using various protocols such as HTTP, HTTPS, and FTP. Nevertheless, sometimes when you try to use the “wget” command, you may see an error message that states “wget: command not found”. This can occur if “wget” isn’t installed on your Linux system, or if the “wget” executable isn’t in the system’s PATH. This post will demonstrate how to resolve this problem message by installing “wget” on your Linux system.

Steps to Install Wget on Linux

1. Open a terminal window.

First, check if “wget” is installed on your system by running the following command:

# which wget

Example output :

/usr/bin/wget

If you encounter the “wget: command not found” error message while using the “wget” command, it means that “wget” is not installed on your system or that the “wget” executable is not included in the system’s PATH.

2. Run the following command to install “wget” on your system. If you are using a different package manager, use the appropriate command for your system :

In Oracle linux

# dnf install wget -y

In Debian/Ubuntu Linux

# sudo apt-get install wget -y

This will install “wget” and any dependencies it needs.

After the installation is complete, you can verify that “wget” is installed by running the following command:

# wget --version

Example output :

GNU Wget 1.19.5 built on linux-gnu.

-cares +digest +gpgme +https +ipv6 +iri +large-file +metalink +nls
+ntlm +opie +psl +ssl/gnutls

Wgetrc:
    /etc/wgetrc (system)
Locale:
    /usr/share/locale
Compile:
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
    -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib
    -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -O2 -g -pipe
    -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
    -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
    -grecord-gcc-switches
    -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
    -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
    -fasynchronous-unwind-tables -fstack-clash-protection
    -fcf-protection
Link:
    gcc -I/usr/include/p11-kit-1 -DHAVE_LIBGNUTLS -DNDEBUG -O2 -g -pipe
    -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
    -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
    -grecord-gcc-switches
    -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
    -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
    -fasynchronous-unwind-tables -fstack-clash-protection
    -fcf-protection -Wl,-z,relro -Wl,-z,now
    -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -luuid -lidn2
    -L/usr/lib64 -lgpgme -lmetalink -lnettle -lgnutls -lz -lpsl
    ftp-opie.o gnutls.o http-ntlm.o ../lib/libgnu.a

Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Originally written by Hrvoje Niksic .
Please send bug reports and questions to .

This should display the version number of “wget” on your system.

Conclusion

On Linux systems, “wget” is an useful command-line programme for downloading files from the internet. If you get the “wget: command not found” error message while using “wget,” install “wget” on your system or add the directory containing the “wget” executable to the system’s PATH. We have provided step-by-step directions for installing “wget” on Linux and fixing the “wget: command not found” error message in this article.

Leave a Comment