How To Install python-utidylib on Ubuntu 18.04

In this tutorial we learn how to install python-utidylib on Ubuntu 18.04. python-utidylib is Python wrapper for TidyLib

Introduction

In this tutorial we learn how to install python-utidylib on Ubuntu 18.04.

What is python-utidylib

python-utidylib is:

Corrects markup in a way compliant with the latest standards, and optimal for the popular browsers. It has a comprehensive knowledge of the attributes defined in the HTML 4.0 recommendation from W3C, and understands the US ASCII, ISO Latin-1, UTF-8 and the ISO 2022 family of 7-bit encodings. In the output:

  • HTML entity names for characters are used when appropriate.
  • Missing attribute quotes are added, and mismatched quotes found.
  • Tags lacking a terminating ‘>’ are spotted.
  • Proprietary elements are recognized and reported as such.
  • The page is reformatted, from a choice of indentation styles.

This package contains uTidylib, a Python wrapper for TidyLib.

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

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

sudo apt-get update

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

sudo apt-get -y install python-utidylib

Install python-utidylib Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-utidylib

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

sudo aptitude -y install python-utidylib

How To Uninstall python-utidylib on Ubuntu 18.04

To uninstall only the python-utidylib package we can use the following command:

sudo apt-get remove python-utidylib

Uninstall python-utidylib And Its Dependencies

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

sudo apt-get -y autoremove python-utidylib

Remove python-utidylib Configurations and Data

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

sudo apt-get -y purge python-utidylib

Remove python-utidylib configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-utidylib

References

Summary

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