Fix 'wget: command not found' error in Linux
Encountering a "wget command not found" error in Linux can be frustrating, especially when downloading files from the web. But don't worry! This error is usually easy to fix. This error usually means that wget is not installed on your system or that wget is not in your system's PATH. This guide will show you the simple steps to get wget up and running so you can start downloading files without any trouble.
Why does the "wget command not found" error occur?
The wget: command not found error in Linux occurs when wget is not installed by default, is not in the system PATH, or is corrupted. Some minimal Linux distributions do not include wget to keep the system lightweight. In this case, we need to install it manually.
If wget is not recognized by your system after installation, it may be outside the PATH. You can fix this by adding its directory to the PATH. Alternatively, a corrupted or deleted wget package can cause this problem, and reinstalling wget should fix it.
Fix 'wget: command not found' error in Linux
Fix 1: Install wget on Linux system
On most Linux distributions, wget comes pre-installed. However, if for some reason wget is not installed on your system, you may see a 'command not found' error. To avoid this error, you should check for wget installation on your system before using it. To do this, you can run the following command:
sudo wget
If your system has wget set up properly, this command will return the message 'wget: missing URL usage:

However, if your Linux system does not have wget installed, you will see the error 'wget: command not found':

To fix this error, install wget using your distribution's package manager. For example, on Debian/ Ubuntu , you can use the apt package manager:
sudo apt-get install wget
You can confirm the installation by checking the wget version:
wget --version
To install wget on RHEL-based Linux distributions, you can use the dnf package manager:
sudo dnf install wget
Similarly, you can use your distribution's package manager to install wget on other Linux variants.
Fix 2: Configure Wget PATH
Sometimes, the problem is not that wget is not installed. In fact, wget may be present on your system, but you still get the 'wget: command not found' error. In such cases, you have to verify whether your system PATH includes wget. To do this, use the which command:
which wget
If this command returns a path like /usr/bin/wget , it means that wget is installed and available in the system PATH:
However, if the command returns no results, your system does not have wget installed or has wget in a directory not listed in the PATH environment variable.
If wget is installed but not in the PATH, you can add it temporarily with the export command:
export PATH=$PATH:/path/to/wget_directory
Replace /path/to/wget_directory with the actual path like /usr/bin:
You can make this change permanent by adding the same line to ~/.bashrc or ~/.bash_profile.
If you regularly download files using wget, make sure your system has it installed and configured properly. Otherwise, you may encounter errors like wget: command not found. This error usually occurs when wget is missing, misconfigured, or corrupted. However, the solution is simple. You can install wget, verify its presence in your system PATH, and make the necessary adjustments. If wget still doesn't work, you can use an alternative like the curl command to download files from the web.
You should read it
- How to install and use wget on Mac
- How to use Wget to download files on Linux
- The difference between cURL and wget
- How to fix 'apt-get: command not found' error in Linux Terminal
- How to convert multiple websites into PDFs with Wget
- How to use the which command in Linux
- 20+ essential Linux security commands
- How to fix Mac Homebrew error 'zsh: command not found: brew'
- How to fix 'An operating system not found' error on Windows 10 and Windows 8.1
- How to use the stat command on Linux
- How to fix Msstdfmt.dll Not Found error
- The Cat command in Linux