How To Install libhtml-gentoc-perl on Ubuntu 18.04

In this tutorial we learn how to install libhtml-gentoc-perl on Ubuntu 18.04. libhtml-gentoc-perl is module that generates a Table of Contents for HTML documents

Introduction

In this tutorial we learn how to install libhtml-gentoc-perl on Ubuntu 18.04.

What is libhtml-gentoc-perl

libhtml-gentoc-perl is:

HTML::GenToc generates anchors and a table of contents for HTML documents. Depending on the arguments, it will insert the information it generates, or output to a string, a separate file or STDOUT.

While it defaults to taking H1 and H2 elements as the significant elements to put into the table of contents, any tag can be defined as a significant element. Also, it doesn’t matter if the input HTML code is complete, pure HTML, one can input pseudo-html or page-fragments, which makes it suitable for using on templates and HTML meta-languages such as WML.

Also included in the distrubution is hypertoc, a script which uses the module so that one can process files on the command-line in a user-friendly manner.

There are three methods to install libhtml-gentoc-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libhtml-gentoc-perl Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libhtml-gentoc-perl

Install libhtml-gentoc-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libhtml-gentoc-perl using apt by running the following command:

sudo apt -y install libhtml-gentoc-perl

Install libhtml-gentoc-perl 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 Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libhtml-gentoc-perl using aptitude by running the following command:

sudo aptitude -y install libhtml-gentoc-perl

How To Uninstall libhtml-gentoc-perl on Ubuntu 18.04

To uninstall only the libhtml-gentoc-perl package we can use the following command:

sudo apt-get remove libhtml-gentoc-perl

Uninstall libhtml-gentoc-perl And Its Dependencies

To uninstall libhtml-gentoc-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libhtml-gentoc-perl

Remove libhtml-gentoc-perl Configurations and Data

To remove libhtml-gentoc-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libhtml-gentoc-perl

Remove libhtml-gentoc-perl configuration, data, and all of its dependencies

We can use the following command to remove libhtml-gentoc-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libhtml-gentoc-perl

References

Summary

In this tutorial we learn how to install libhtml-gentoc-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.