Fix 'wget: command not found' error in Linux
Encountering a "wget command not found" error in Linux can be frustrating, especially when downloading files from the web. But don't worry! This error is usually easy to fix. This error usually means that wget is not installed on your system or that wget is not in your system's PATH. This guide will show you the simple steps to get wget up and running so you can start downloading files without any trouble.
Why does the "wget command not found" error occur?
The wget: command not found error in Linux occurs when wget is not installed by default, is not in the system PATH, or is corrupted. Some minimal Linux distributions do not include wget to keep the system lightweight. In this case, we need to install it manually.
If wget is not recognized by your system after installation, it may be outside the PATH. You can fix this by adding its directory to the PATH. Alternatively, a corrupted or deleted wget package can cause this problem, and reinstalling wget should fix it.
Fix 'wget: command not found' error in Linux
Fix 1: Install wget on Linux system
On most Linux distributions, wget comes pre-installed. However, if for some reason wget is not installed on your system, you may see a 'command not found' error. To avoid this error, you should check for wget installation on your system before using it. To do this, you can run the following command:
sudo wget
If your system has wget set up properly, this command will return the message 'wget: missing URL usage:
However, if your Linux system does not have wget installed, you will see the error 'wget: command not found':
To fix this error, install wget using your distribution's package manager. For example, on Debian/ Ubuntu , you can use the apt package manager:
sudo apt-get install wget
You can confirm the installation by checking the wget version:
wget --version
To install wget on RHEL-based Linux distributions, you can use the dnf package manager:
sudo dnf install wget
Similarly, you can use your distribution's package manager to install wget on other Linux variants.
Fix 2: Configure Wget PATH
Sometimes, the problem is not that wget is not installed. In fact, wget may be present on your system, but you still get the 'wget: command not found' error. In such cases, you have to verify whether your system PATH includes wget. To do this, use the which command:
which wget
If this command returns a path like /usr/bin/wget , it means that wget is installed and available in the system PATH:
However, if the command returns no results, your system does not have wget installed or has wget in a directory not listed in the PATH environment variable.
If wget is installed but not in the PATH, you can add it temporarily with the export command:
export PATH=$PATH:/path/to/wget_directory
Replace /path/to/wget_directory with the actual path like /usr/bin:
You can make this change permanent by adding the same line to ~/.bashrc or ~/.bash_profile.
If you regularly download files using wget, make sure your system has it installed and configured properly. Otherwise, you may encounter errors like wget: command not found. This error usually occurs when wget is missing, misconfigured, or corrupted. However, the solution is simple. You can install wget, verify its presence in your system PATH, and make the necessary adjustments. If wget still doesn't work, you can use an alternative like the curl command to download files from the web.
You should read it
- The difference between cURL and wget
- How to fix 'apt-get: command not found' error in Linux Terminal
- How to convert multiple websites into PDFs with Wget
- How to use the which command in Linux
- 20+ essential Linux security commands
- How to fix Mac Homebrew error 'zsh: command not found: brew'
- How to fix 'An operating system not found' error on Windows 10 and Windows 8.1
- How to use the stat command on Linux
May be interested
- 18 Interesting Linux Commands in Terminalterminal is a very powerful tool, but it can be made 'interesting' through a few bash commands that tipsmake.com will introduce to you below. let's follow and learn because some commands are quite useful.
- The Cat command in Linuxthe cat command (short for 'concatenate') is one of the most frequently used commands in operating systems like linux / unix. the cat command allows users to create one or more files, view file contents, join files, and redirect output in a terminal or file.
- How to use the last command in Linuxwant to know who, what time and which device to access your linux computer? please read the following article.
- How to use ss command on Linuxthe ss command is a new alternative to the classic netstat. you can use it on linux to get data about network connections. here's how to work with this helpful tool.
- 11 uses of ps command in Linuxfor system administrators, ps is a frequently used tool. the ps command is used to list the processes currently running on the system, with many available filtering and display modes via flags and arguments.
- Instructions for using zforce command on Linuxthe gzip command is a popular tool used to compress / decompress files in linux. tipsmake.com presents the basics of this tool in the article: some basic terminal commands in linux mint 11.
- How to limit access to su command in Linuxif you have added linux to your data center or are just using a single linux machine for your business, you need to make sure it is as secure as possible.
- 12 things Linux is easier to do in the command line than graphical softwaregraphical user interfaces (guis) were invented to make life easier for computer users, so it's very common to use them to perform most everyday tasks.
- 11 df commands in Linux (with example)with the df command in linux, you can easily check your system for details about disk space and file size. these 12 examples of df commands will show you how to do them in detail.
- How to use the Linux command line on Android with Termuxandroid is a very operating system 'capacity with more and more desktop accessibility applications. however, sometimes you want to make some things on android that can be as easy as desktop. fortunately, you can use the termux tool, which builds on the existing infrastructure and provides a command line environment that allows you to install real linux applications on your android device.