Fix CentOS ‘wget command not found’ Error

If you encounter a “command not found” error when running the wget command in CentOS, it may be due to wget not being installed or not being found. You can resolve this issue by following these steps:

  1. Verify if wget is installed: run the following command to check if wget is installed:
which wget

If wget is installed, it will display the installation path. If there is no output, it means wget is not installed.

  1. To install wget: If wget is not already installed, you can install it using the following command:
sudo yum install wget

This will install wget from the CentOS software repository using the yum package manager. Depending on the system configuration and permissions, you may be required to provide the sudo password.

  1. Check the environment variables: Sometimes, even if wget is installed, the system may not be able to find it due to configuration issues with the environment variables. You can check the environment variables by running the following command:
echo $PATH

Make sure the installation path of wget is included in the path. If it’s not included, you can manually add the installation path of wget to the environment variable. For example, if wget is installed in /usr/bin/wget, you can use the following command to add it to the environment variable:

export PATH=$PATH:/usr/bin
  1. Refresh your login or reload environment variables: If you have made changes to the environment variables, you will need to either log out and log back in or reload the environment variables for the changes to take effect. You can try logging out and logging back in, or use the following command to reload the environment variables:
source ~/.bashrc

The above steps should be able to solve the issue of the “wget command not found” in CentOS.

bannerAds