wget command not found [How to Fix and Use wget]

One of the most popular commands used in Linux is the wget command. This is a command that is used to download files or resources from the internet. And it can also be used to copy and paste files from different directories. But sometimes it could give errors like wget command not found. If you are getting the same error, here is how to fix wget command not found.

Linux is an operating system used by a large number of people. And many users use Linux for the command line interface. Well, there are Linux distributions that offer good GUI but linux is well known for its command line interface. And there are a bunch of commonly used commands like yum command and wget command.

As the wget command is a very useful one, it always comes in handy in many situations. But, what do you do when it stops working? Well, there is a solution that you can follow to get the wget command working and solve the wget command not found message.

How to Resolve wget command not found

If you seem to be getting wget command not found message, there is only one reason why the message is popping up. It is because it might be missing or not installed on the OS. You might also get a message that reads bash: /usr/bin/wget: No such file directory found. So, in order to find out if the wget command is installed on your system, you need to follow the steps below.

  • Launch the Terminal Shell by pressing the Ctrl+Alt+T keys on your keyboard.
  • Once the terminal Shell loads, simply type in /usr/bin/wget
  • If it returns with wget missing or wget not found, it is time to install wget on your system.

How to Install wget on Linux system

Now, depending on the type of Linux distribution that you are running on, the commands will vary a bit when it comes to installing wget on your system. No matter what the distribution, you will have to run the commands in the Terminal Shell as you normally would run other commands.

Install wget on Debian, Kali, Mint, and Ubuntu 

There are two commands and you can use either one of them to install wget on your system.

  • $ sudo apt install wget

Or

  • $ sudo apt-get install wget

Install wget on CentOS, Fedora, RHEL

If you are running these particular distributions of Linux, you can make use of the yum or dnf package commands to install wget. If you have an issue with the yum command not working or not found, you can follow this guide to solve the issue.

  • $ sudo dnf install wget
  • $ sudo yum install wget

Now that you have installed wget on your systems, it is now to check and see if it is present and also see the version number of wget. All you need to do is launch Terminal and then type in

  • $ wget -V

Once you hit the enter key, you’ll now be seeing the version number of wget that is installed on the system.

How to Use wget Command

Well now that the wget command has been installed, you might be wondering what are its actual use cases in Linux? Here are some of the wget commands that are used in Linux.

Downloading content from the internet

You can download contents using the wget command. To download content using the wget command you need to type the below command.

$ wget: (download link)

The download link will be without a bracket. Press the enter key. The file will now begin to download to your system.

Downloading a file with a custom file name

At times, you might have seen a few files having large name strings filled with random alphabets. Now, if you want to give your name to this downloaded file, you need to enter the following command 

$ wget -O (insert your custom file name) (download link or URL)

The file will begin to download and you will see it saved with the name that you have given in the command.

Download file to a particular folder

Downloads will usually be saved to the Downloads folder, But, if you plan to download a particular file to any other folder, you need to use this command.

$ wget -P -/(folder name) (insert download link)

Limit Download speed for a file

If you have an internet connection that is slow or weak and you need to download a particular file, you can now set the bandwidth speed to download the file slowly or quickly. Here is the command.

$ wget - -limit-rate+(insert internet speed) (download link or URL goes here)

Resume File Download

If you have used the wget command to download a file to your system and for some reason either because of a server issue or an internet problem at your end the file stops downloading, you can resume such downloads by using the wget command.

$ wget -O-c (download link here)

Once this command has been entered, the file will resume its download from where it previously stopped.

And this is how you can fix the wget command not found message on your Linux system. Apart from that, you now also know what the wget command is used for and why it is important to fix such issues. If you have queries or doubts, feel free to leave them in the comments section below.

Also Check:

Share on:
Photo of author

By Joshua D'souza

Enjoys games, 90's hip-hop, and tech. Loves exploring the infinite world of laptops and food. Every ready to provide assistance in anything that rocks his boat. Will gladly enjoy capturing memories through various lenses. Worked previously at PiunikaWeb as an author and researcher.

Leave a Comment