How To Install wget on Debian 9

In this tutorial we learn how to install wget on Debian 9. wget is retrieves files from the web

Introduction

In this tutorial we learn how to install wget on Debian 9.

What is wget

wget is:

Wget is a network utility to retrieve files from the web using HTTP(S) and FTP, the two most widely used internet protocols. It works non-interactively, so it will work in the background, after having logged off. The program supports recursive retrieval of web-authoring pages as well as FTP sites – you can use Wget to make mirrors of archives and home pages or to travel the web like a WWW robot.

Wget works particularly well with slow or unstable connections by continuing to retrieve a document until the document is fully downloaded. Re-getting files from where it left off works on servers (both HTTP and FTP) that support it. Both HTTP and FTP retrievals can be time stamped, so Wget can see if the remote file has changed since the last retrieval and automatically retrieve the new version if it has.

Wget supports proxy servers; this can lighten the network load, speed up retrieval, and provide access behind firewalls.

There are three methods to install wget on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install wget Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install wget using apt-get by running the following command:

sudo apt-get -y install wget

Install wget Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install wget using apt by running the following command:

sudo apt -y install wget

Install wget Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install wget using aptitude by running the following command:

sudo aptitude -y install wget

How To Uninstall wget on Debian 9

To uninstall only the wget package we can use the following command:

sudo apt-get remove wget

Uninstall wget And Its Dependencies

To uninstall wget and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove wget

Remove wget Configurations and Data

To remove wget configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge wget

Remove wget configuration, data, and all of its dependencies

We can use the following command to remove wget configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge wget

Dependencies

wget have the following dependencies:

References

Summary

In this tutorial we learn how to install wget package on Debian 9 using different package management tools: apt, apt-get and aptitude.