How to fix wget command not found

Endrit Qerreti

Endrit Qerreti

wget is a free tool that you can install and use on any linux distro.

Let's say you wanted to download a file on your Linux distro, but you didn't want to use your browser. wget makes this possible, as you can download anything you want directly from your terminal.

When wget is not installed, or when wget installation is broken, you may get the error wget command not found.

This error means that there's something wrong with your wget installation.However, this error can be easily fixed by following the steps below.

In this tutorial, you will learn how to fix wget command not found.

Step 1 - Check if wget is installed

The first thing that you need to do is checking if wget is installed on your machine. Even if you are getting the error wget command not found, it doesn't mean that wget isn't installed on your system.

The reason for this error, could be that wget is not configured and not added to your PATH, so when you try to run wget you get the error wget command not found.

To check if wget is installed, you can use whereis and which commands, both these commands can tell us if wget is installed.

whereis command will show you where wget files are, while which command will show you what binary path is being used when you call wget

To check where wget files are, run the command below.

whereis wget

As you can see, we didn't get any results, this means that there's no source or binary file for wget on our machine.

Next, you can check if wget is installed by using the which command

which wget

Both outputs indicate that there are no binary, or other files being used by wget, which means that wget is not actually installed.

Step 2 - Install wget

wget can be easily downloaded and installed on your machine. In this tutorial, we are using Debian 12 to troubleshoot this error.

wget is included in the main Debian 12 repository, which means you don't have to add any repository manually in your system in order to install wget.

To install wget on your machine, you can do so by running the command below.

sudo apt install wget

Step 3 - Check if Error is gone

Now that wget has been installed on your machine, you can proceed to check if the error wget command not found is gone.

To check if the error is gone, simply run the same command that you were executing. In our case we were only trying to run wget.

wget

Output

owlhowto@debian-12:~$ wget
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

As you can see the error is fixed, and wget is working.

Step 4 - Use wget

The error "wget command not found" is now fixed, and you should be able to use wget on your machine.

To use wget, you can do so via your terminal.

Simply launch your terminal, and run wget.

wget

Conclusion

In this tutorial, you learned how to fix wget command not found error, that happens when you run wget command in the terminal without wget being installed in that machine.