List of content you will read in this article:
Before knowing more about How To Fix wget command not found error, we need to know what Wget is? Linux is the most versatile operating system, providing several commands to ease your manual effort of scrolling through the entire system. You can get your work done from a single interface called a command-line terminal that is easy to access and learn. Like Windows operating system, you will also need to install software from the internet. But on Linux, you can hit the command to get this done.
What is wget Command?
Wget is a free software package that can be used to retrieve files from the World Wide Web. The program supports HTTP, HTTPS, and FTP protocols and retrieval through HTTP proxies.
Wget is a command-line program, which can only be used from the command-line interface (CLI). This can be a problem for users unfamiliar with the CLI, but there are many resources available to help them learn how to use it.
Once wget is installed on a system, it can be invoked by simply typing "wget" at the command prompt. Basic usage typically looks like this:
where [URL] is the address of the file to be downloaded. For example, to download the file "example.html" from the website "www.monovm.com", the following command would be used:
If successful, this command will save the file "example.html" in the current directory. Additional options can be used to change this behavior; see the wget documentation for more details.
This command only works in the background, thus considered a non-interactive command. After executing this command, the user can disconnect from the system, as the work will be done in the background.
This command proves beneficial when you have to download the file from a slow or unstable network. If the network disconnects during the download, the command will automatically resume once the network connects again.
What are the possible reasons for the error of wget:command not found?
There are a few possible reasons for the error of wget command not found:
1. The wget command is not installed on your system. This is the most common reason for this error. To fix this, you will need to install wget.
2. The wget command is not in your system's PATH. Your system does not know where to find the wget executable. To fix this, you must add the directory containing the wget executable to your system's PATH.
3. You are using an incorrect version of the wget command. This can happen if you are using an old version of wget that is no longer compatible with your system. To fix this, you will need to upgrade to the latest version of wget.
4. using the incorrect syntax of wget command
How To Fix wget command not found?
But, there could be some reasons that fail this command and displaying an error message as:
“–bash:wget:command not found”
This error specifies that the “wget” utility is not present on your Linux system or not responding as expected. You can review this article to resolve this issue on your Ubuntu system.
It is the most commonly used utility. Before you start using this utility, make sure you have it installed. This command comes with the following syntax.
wget [option] [URL]
Both the parameters- option and URL- are optional in the above syntax. This utility comes with several options ensuring different functionality. The available options are -V or –version, -h or –help, -b or –background, and -e or –execute. URL specifies the location from where you want to download the specific file. Below we have mentioned the usage of some of these options.
Check `wget` command is installed or not.
To get the expected output of this command, you first need to ensure that your system has this utility installed. Running the following command will also provide you with the installed version of “wget” details. If the utility is not present, you will get the error.
$ wget –V
You will see which version of “wget” you have on your system in the below image.
Install the wget command on Ubuntu
If you do not have the “wget” utility on your system, you can impliment it by executing the below-mentioned simple command via the command line.
$ sudo apt-get install wget
Once you are done with the installation process, check the installed version using the previous command. To get the detailed output of the “wget” command, you can use the “-h” option below.
$ wget -h
Using the “wget” command without any option
In the below example, we are using the “wget” command to download the index.html file from the site. The downloaded file will be stored in the current working directory. You can execute the ‘ls’ command to check if the HTML file is created or not in the current directory.
$ wget https://linuxhint.com
Using the `wget` command with -b option
If you want to complete the download process in the background, you can use the :-b” option and the “wget” command. The below-mentioned command will download the emp.zip file from the site in the background.
$ wget -b https://fahmidasclassroom.com/temp.zip
Using the `wget` command with the -c option.
If you want to complete the pending download, you can use the “c” option along with the “wget” command. The “wget” utility allows you to resume the pending download. If any download is incomplete due to a slow network, you can use the “wget” command to resume the download using the “-” option.
In the below example, we are resuming the download of file xampp-Linux-x64-7.2.2-0-installer.run. You can execute the following command to complete the partial download of xampp installer file.
$ wget -c https://www.apachefriends.org/xampp-files/7.2.2/
Using the `wget` command with -O option
If you want to store the downloaded file with another name, you can use the “-O” option along with the “wget” command. Execute the following command to download the file
google-chrome-stable_current_amd64.deb with the different name, chrome.deb.
$ wget –O chrome.deb https://dl.google.com/linux/direct/
Linux comes with several useful utilities helping you with tasks. “Wget” is also a utility allowing you to download files from the internet. Even you can use it to resume the pending downloads. This article lets you know how different “wget” options work and How To Fix wget command not found? You can use them efficiently you must ensure that this utility is installed on your system to work smoothly. Also, if you have an outdated version, update it before using it.
People also read: