xmltidy command not found

In this troubleshooting guide we learn how to fix xmltidy command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

xmltidy: command not found

or when using sudo you get the following error message

sudo: xmltidy: command not found

Solutions to xmltidy: command not found

How To Fix xmltidy: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu xmltidy is provided by libxml-tidy-perl package.

libxml-tidy-perl is:

XML::Tidy creates XML document objects (with inheritance from XML::XPath) to tidy mixed-content (ie. non-data) text node indenting. There are also some other handy member functions to compress && expand your XML document object (into either a compact XML representation or a binary one).

To fix this problem, we can install more using the command below.

sudo apt-get -y install libxml-tidy-perl

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install libxml-tidy-perl.

sudo apt -y install libxml-tidy-perl

Or if you have aptitude installed you can use the following command.

sudo aptitude install libxml-tidy-perl

Summary

In this tutorial we learn how to fix xmltidy command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.