How to fix “wget: command not found”

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:

  1. 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:

arduino
sudo apt-get install wget

On Red Hat-based systems like CentOS or Fedora, you can use the following command:

sudo yum install wget
  1. 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:

bash
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:

ruby
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).

  1. 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.