
Encountering the “wget command not found” error on your Linux system can be quite inconvenient, especially when you’re eager to download files from the internet. However, there’s no need to fret! This error usually indicates that the wget utility is either not installed or is absent from your system’s PATH. In this comprehensive guide, we’ll explore actionable steps to correctly set up wget so you can resume downloading files effortlessly.
What Causes the “wget command not found” Error?
The wget: command not found error in Linux typically arises due to one of the following reasons:
- Missing Installation: Certain minimalist Linux distributions might not pre-install wget to conserve resources.
- PATH Misconfiguration: If wget is installed but not included in your system’s PATH, your terminal won’t recognize the command.
- Corrupted Installation: A corrupted wget installation may also trigger this error message.
Fortunately, all these issues can be resolved with straightforward solutions, which we will outline in the following sections!
Step 1: Installing wget on Your Linux System
While wget is often pre-installed on numerous Linux distributions, it’s wise to verify its availability prior to use. You can check for wget installation by running the command:
sudo wget
If wget is in good standing on your system, the terminal will display a usage message indicating that a URL is required. If you receive the error “wget: command not found, ” it means wget is absent.

Installing wget on Debian/Ubuntu
To rectify this, install wget using the apt package manager with the following command:
sudo apt-get install wget

Verify the installation by checking the version:
wget --version

Installing wget on RHEL-based Distributions
For users on RHEL-based distributions, the installation command using the dnf package manager is:
sudo dnf install wget
Similar commands can be utilized for other Linux variants, ensuring that wget is readily installed and accessible on your system.
Step 2: Configuring Wget’s PATH
If wget is installed but still triggers the ‘wget: command not found’ error, the issue may lie with the PATH configuration. To check if wget’s directory is present in your PATH, use the which
command:
which wget
Should this command yield a path such as /usr/bin/wget
, it confirms that wget is correctly installed within your system’s PATH.

In cases where the command returns no output, you may need to add wget’s directory to your PATH. You can temporarily do this using:
export PATH=$PATH:/path/to/wget_directory
For example, replace /path/to/wget_directory
with the functional path:

To ensure this change persists across sessions, append the export command to your ~/.bashrc
or ~/.bash_profile
.
Conclusion
If you frequently rely on wget to download files, ensuring its proper installation and configuration is vital. Beyond troubleshooting, always remember that if wget continues to elude you, commands like curl can serve as reliable alternatives for file retrieval from the web.
Image credit: All alterations and screenshots by Anees Asghar.
Frequently Asked Questions
1. What should I do if wget is not found after installation?
If you have installed wget but are still facing the “command not found”error, check if the wget directory is included in your system’s PATH. You can do this using the which wget
command.
2. Are there any alternatives to wget?
Yes! If you cannot get wget to work, you can use curl as an alternative command-line tool for transferring data. It is highly capable and works effectively for file downloads.
3. Can I permanently add wget to my PATH?
Yes! To make wget accessible from any directory, you can add its installation path to your system’s PATH variable permanently by including the export command in the ~/.bashrc
or ~/.bash_profile
file.
Leave a Reply ▼