How to fix wget command not found RedHat Linux/CentOS?


If you get a "wget command not found" error message, wget is not installed in your system. wget is a non-interactive network downloader utility available for Linux. Let us see how to install wget command in Linux/CentOS.

Code:
-bash: wget: command not found
You would get this error if your system does not have wget installed.

Code:
[admin@devopsrun ~]$ wget www.devopsrun.com
-bash: wget: command not found
You can install wget utility using yum install: sudo yum install wget

Installing wget command Linux/CentOS


You can install wget using sudo yum install wget, provided you have sudo privileges.

Code:
[admin@devopsrun ~]$ sudo yum install wget
Loaded plugins: fastest mirror, langpacks
Loading mirror speeds from cached host file
***
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
=======================================================
Package      Arch    Version        Repository  Size
=======================================================
Installing:
wget        x86_64  1.14-18.el7_6.1 updates    547 k

Transaction Summary
=======================================================
Install  1 Package
Total download size: 547 k
Installed size: 2.0 M
Is this ok [y/d/N]:
Enter y to continue

Downloading packages:
wget-1.14-18.el7_6.1.x86_64.rpm  | 547 kB  00:00:01
Running transaction check
Running transaction test 
Transaction test succeeded
Running transaction                                   
  Installing : wget-1.14-18.el7_6.1.x86_64      1/1
  Verifying  : wget-1.14-18.el7_6.1.x86_64      1/1

Installed:                     
  wget.x86_64 0:1.14-18.el7_6.1

Complete!

Testing the wget command


Let us fire-up the wget command,
Code:
[admin@devopsrun ~]$ wget www.devopsrun.com
--2010-01-01 03:07:38--  https://www.devopsrun.com/
Resolving www.devopsrun.com (www.devopsrun.com)... XXX.XXX.XXX.XXX
Connecting to www.devopsrun.com (www.devopsrun.com)|XXX.XXX.XXX.XXX|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

    [ <=>                                              ] 23,288      119KB/s  in 0.2s

2010-01-01 03:07:39 (119 KB/s) - ‘index.html’ saved [23288]
[admin@devopsrun ~]$
You have just downloaded the home page of this website using wget!