xhtml2ps command not found

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

Introduction

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

xhtml2ps: command not found

or when using sudo you get the following error message

sudo: xhtml2ps: command not found

Solutions to xhtml2ps: command not found

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

In Ubuntu xhtml2ps is provided by xhtml2ps package.

xhtml2ps is:

This program converts HTML directly to PostScript. The HTML code can be retrieved from one or more URLs or local files, specified as parameters on the command line. A comprehensive level of HTML is supported, including inline images, CSS 1.0, and some features of HTML 4.0.

This package provides an (outdated) GUI frontend to the html2ps converter.

This is our justification for the suggests list:

We suggest weblint-perl because it is the default method for checking HTML syntax (see Operations | Preferences).

We suggest lpr because it is the default printing command (see Operations | Preferences).

We suggest mailcap because see is the default command used to open the postscript viewer (see Operations | Preferences).

We suggest postscript-viewer because this package generates postscripts which can be viewed with postscript-viewer (see Operations | Preferences).

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

sudo apt-get -y install xhtml2ps

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

You can also use apt command to install xhtml2ps.

sudo apt -y install xhtml2ps

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

sudo aptitude install xhtml2ps

Summary

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