How To Install libhtmlparser-java on Ubuntu 18.04

In this tutorial we learn how to install libhtmlparser-java on Ubuntu 18.04. libhtmlparser-java is java library to parse html

Introduction

In this tutorial we learn how to install libhtmlparser-java on Ubuntu 18.04.

What is libhtmlparser-java

libhtmlparser-java is:

HTML Parser is a Java library used to parse HTML in either a linear or nested fashion. Primarily used for transformation or extraction, it features filters, visitors, custom tags and easy to use JavaBeans.

The two fundamental use-cases that are handled by the parser are extraction and transformation (the syntheses use-case, where HTML pages are created from scratch, is better handled by other tools closer to the source of data).

In general, to use the HTMLParser you will need to be able to write code in the Java programming language. Although some example programs are provided that may be useful as they stand, it’s more than likely you will need (or want) to create your own programs or modify the ones provided to match your intended application.

There are three methods to install libhtmlparser-java 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 libhtmlparser-java Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libhtmlparser-java

Install libhtmlparser-java Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libhtmlparser-java

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

sudo aptitude -y install libhtmlparser-java

How To Uninstall libhtmlparser-java on Ubuntu 18.04

To uninstall only the libhtmlparser-java package we can use the following command:

sudo apt-get remove libhtmlparser-java

Uninstall libhtmlparser-java And Its Dependencies

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

sudo apt-get -y autoremove libhtmlparser-java

Remove libhtmlparser-java Configurations and Data

To remove libhtmlparser-java configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libhtmlparser-java

Remove libhtmlparser-java configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libhtmlparser-java

References

Summary

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