The “wget: command not found” error message usually means that the wget package is not installed on your system or is not in the system’s PATH. Here are the steps to fix this error:
- Install wget package:
If wget is not installed on your system, you can install it using your system’s package manager. For example, on Debian-based systems like Ubuntu, you can use the following command:
sudo apt-get install wget
On Red Hat-based systems like CentOS or Fedora, you can use the following command:
sudo yum install wget
- Check the system’s PATH:
If wget is already installed on your system but you’re still getting the error message, you should check if the wget executable is in the system’s PATH. You can do this by typing the following command:
echo $PATH
This command will display a list of directories separated by colons. Make sure that one of the directories listed is the directory where the wget executable is located (usually /usr/bin). If the directory is not listed, you can add it to the PATH variable by typing the following command:
export PATH=$PATH:/usr/bin
This command adds /usr/bin to the PATH variable temporarily. If you want to make this change permanent, you should add the above command to your shell’s configuration file (e.g., .bashrc or .zshrc).
- Check the wget command spelling:
It’s possible that you misspelled the “wget” command. Make sure you typed the command correctly, with no typos or misspellings.
By following these steps, you should be able to fix the “wget: command not found” error and use the wget command without any issues.