How to solve the error “bash: wget: command not found”

Wget is a non-interactive downloader that downloads files from the Internet. The HTTP and FTP protocols are used to download files over the Internet. However, if you have not installed the wget utility on your system, then you may receive a “bash: wget: command not found” error at runtime. This article will quickly help you resolve the “bash: wget: command not found” error.

Error description:

You will receive the following error message when using the wget command:

[[email protected] ~]# wget
-bash: wget: command not found

How to resolve the “bash: wget: command not found” error

In order to resolve the “bash: wget: command not found” error, you need to install the wget utility on the server.

On Debian and Ubuntu:

[email protected]:~# apt-get install wget

Example installation log:

[email protected]:~# apt-get install wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 298 kB of archives.
After this operation, 901 kB of additional disk space will be used.
Get:1 xenial-updates/main amd64                                                                                         
wget amd64 1.17.1-1ubuntu1.2 [298 kB]
Fetched 298 kB in 0s (401 kB/s)
Selecting previously unselected package wget.
(Reading database ... 51222 files and directories currently installed.)
Preparing to unpack .../wget_1.17.1-1ubuntu1.2_amd64.deb ...
Unpacking wget (1.17.1-1ubuntu1.2) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up wget (1.17.1-1ubuntu1.2) ...

On RHEL and Centos.

[[email protected] ~]# yum install wget

Example installation log:

[[email protected] ~]# yum install wget
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-13.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
Package                        Arch                             Version                               Repository                                                  Size
wget                           x86_64                           1.14-13.el7                           rhui-REGION-rhel-server-releases                           546 k
Transaction Summary
Install  1 Package
Total download size: 546 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
wget-1.14-13.el7.x86_64.rpm                                                                                                                      | 546 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wget-1.14-13.el7.x86_64                                                                                                                              1/1
  Verifying  : wget-1.14-13.el7.x86_64                                                                                                                              1/1
  wget.x86_64 0:1.14-13.el7
[[email protected] ~]#

How to use wget to download files over the Internet.


wget http://url/file
wget ftp://url/file

Load log examples:

[[email protected] ~]# wget
--2017-05-06 11:21:34--
Resolving ( failed: Name or service not known.
wget: unable to resolve host address ‘’
[[email protected] ~]# wget
--2017-05-06 11:21:34--
Resolving (,,
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14704 (14K) [application/x-rpm]
Saving to: ‘epel-release-7-9.noarch.rpm’
100%[==============================================================================================================================>] 14,704      57.8KB/s   in 0.2s
2017-05-06 11:21:34 (57.8 KB/s) - ‘epel-release-7-9.noarch.rpm’ saved [14704/14704]

In the above example, we downloaded the file “rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm” from the URL “ el6.rf.x86_64.rpm ”using the HTTP protocol.