How To Install html2text on Debian 11

In this tutorial we learn how to install html2text on Debian 11. html2text is advanced HTML to text converter

Introduction

In this tutorial we learn how to install html2text on Debian 11.

What is html2text

html2text is:

html2text is a converter from HTML to plain text.

html2text reads HTML documents supplied in the command line (or from standard input), converts each of them into a stream of plain text characters and writes output to the file or the terminal.

Debian version also can recognize encoding of documents, do on-fly input and output recoding.

html2text was written because the author wasn’t happy with the output of “lynx -dump” and so he wrote something better.

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

Install html2text Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install html2text

Install html2text Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install html2text

Install html2text 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 html2text using aptitude by running the following command:

sudo aptitude -y install html2text

How To Uninstall html2text on Debian 11

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

sudo apt-get remove html2text

Uninstall html2text And Its Dependencies

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

sudo apt-get -y autoremove html2text

Remove html2text Configurations and Data

To remove html2text configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge html2text

Remove html2text configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge html2text

Dependencies

html2text have the following dependencies:

References

Summary

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