Or copy link
Copy link
wget is a widely renowned command-line utility in Linux that lets us download files from the web. However, facing the “wget command not found” error can be frustrating when you’re trying to use the wget command to download files in Linux. This error usually occurs if the wget is not installed on your system or your system can’t find it in the PATH.
In this tutorial, we’ll demonstrate how to fix the wget: command not found error in a Linux environment.
The “wget command not found” error usually occurs for two reasons:
Go through the following fixes to learn how to resolve the “wget: command not found” error by installing wget on your system or configuring the PATH appropriately.
Experience Ultahost’s Cheap Linux VPS!
Ultahost Linux VPS gives you complete control and flexibility. It handles all the administrative tasks to ensure your servers stay fast and reliable!
Let’s check the wget version to verify if it is installed on your system or not:
wget --version
If you get results like this, it means wget is not installed on your system yet:
In that case, you can install wget on your Linux distribution to fix wget: command not found error. To install wget on a Debian-based Linux system, run the below-given command:
sudo apt install wget
Now check the wget command to verify its installation on your Debian-based Linux system:
If you get output something like this, it means you’ve successfully installed wget:
Read also How to Install wget on Windows
You can use your distribution’s package manager to install wget on your system. For instance, the below-given command install wget on Fedora/RHEL:
sudo dnf install wget
Similarly, the Arch users can use the Pacman package manager to install wget:
sudo pacman -S wget
If wget is installed but you’re still facing the ‘wget: command not found’ error, it means wget is not added to the system’s PATH. Use the which command to check its location and ensure it is in the PATH:
which wget
If the output shows a path to wget, it means wget is already added to the system’s PATH:
However, it retrieves nothing, which means wget is not added to the system’s PATH. In that case, you must execute the following command:
export PATH=$PATH:/path/to/wget
This command temporarily adds wget’s path to your system’s PATH. Be sure to replace /path/to/wget with the actual directory where wget is located. To make this change permanent, add this line to your shell configuration file, such as ~/.bashrc for Bash.
~/.bashrc
The “wget: command not found” error in Linux can be easily fixed by installing wget on your system or ensuring that its path is correctly added to the system’s PATH. If wget is not installed, using the appropriate package manager for your distribution will resolve the issue. If wget is installed but not recognized, adding its directory to the PATH will allow the system to locate it. In this tutorial, we illustrated both these approaches to quickly resolve the issue and get back to downloading files with wget on your Linux system.
We hope this guide has helped you fix the wget: command not found error. Consider Ultahost’s SSH VPS Hosting which gives you full root access to easily install missing utilities like wget. With complete control over your server, you can fix errors, optimize performance, and ensure smooth operation.
It typically occurs when the wget is not installed on your system or when its path is not included in the system’s PATH variable.
You can check if wget is installed by running the command wget –version in the terminal. If it’s installed, it will display version information.
Use the sudo apt install wget command for Debian/Ubuntu, sudo dnf install wget command for Fedora/RHEL, and sudo pacman -S wget for Arch Linux.
The PATH variable is a list of directories where the system looks for executable programs. If a program like wget is not in one of these directories, it won’t be found by the system when you try to run it.
If wget is installed but still not found, you may need to add its directory to your system’s PATH. You can check its location with which wget and then update the PATH by running export PATH=$PATH:/path/to/wget command.
To make the PATH change permanent, add the export command (export PATH=$PATH:/path/to/wget) to your shell configuration file, like ~/.bashrc, and then reload the file using source ~/.bashrc.
Yes, you can use other command-line tools like curl for downloading files. However, wget is a widely preferred utility due to its robust features for downloading files and handling links.
In Linux systems, processes are the backbone of system ...
The find command in Linux is a powerful and versatile t...
Kali Linux is a popular operating system used for secur...
The .bashrc file is a shell script that runs every time...
File handling is a day-to-day task of Linux users and a...
The chsh command a utility commonly found in Linux dist...
Save my name, email, and website in this browser for the next time I comment.
Δ