≡ Menu

How to install wget on a Debian or Ubuntu Linux

I recently switched from Windows server operating system to Debian Linux for my PHP based apps. I need to install something using wget. But it says:
    bash: wget: command not found
How do I solve this problem? How can I install wget tool on a Debian Linux home server?

The GNU Wget is a free and open source tool for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies and much more. Let us see how to search for a package named wget to retrieves files from the web and install the same on your server.

Installing wget on a Debian Linux

You need to use the apt-get command/apt command to install any package including wget. You can search for package name using the apt-cache command. The syntax is:
$ apt-cache search {package}
$ apt-cache search wget
$ apt-cache search wget | grep wget
$ apt search wget

Sample outputs:

Fig.01: apt-cache search command search performs a full text search on all available package lists

Fig.01: apt-cache search command search performs a full text search on all available package lists

The second last result indicate that the package name is wget. To install wget package use the following syntax:
$ sudo apt-get install {package-name-here}
OR directly run as root user:
# apt-get install {package-name-here}
For example, install wget using the apt-get command/apt command command line as follows:
$ sudo apt install wget
$ sudo apt-get install wget
Sample outputs:
Fig.02: Installing wget on a Debian or Ubuntu Linux

Fig.02: Installing wget on a Debian or Ubuntu Linux

How to use wget command

Once installed you can grab or download file using the following syntax
wget http://url/file
wget ftp://domain/file.tar.gz

See the following wget command related tutorials for more info:

  1. How to use wget command
  2. How To Use wget With Username and Password for FTP / HTTP File Retrieval
  3. Run wget In Background For an Unattended Download of Files on Linux and Unix
  4. Use wget Command To Download Files From HTTPS Domains
  5. Wget: Resume Broken Download
Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 4 comments… add one }
  • horst February 16, 2017, 7:08 am

    what a dump fuck !!!!!

    • Vivek Gite February 16, 2017, 7:32 am

      So you were born with all knowledge and you have never once needed to seek information??? Be nice to new users.

  • Thrbn February 16, 2017, 7:16 am

    Is there any bad thing about using apt install and apt search instead of apt-get and apt-cache? As I understand it, apt search is newer and also has a nicer more colorful output :)

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , ,