ansi2html command not found

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

Introduction

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

ansi2html: command not found

or when using sudo you get the following error message

sudo: ansi2html: command not found

Solutions to ansi2html: command not found

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

In Ubuntu ansi2html is provided by colorized-logs package.

colorized-logs is:

Some tools like gcc, dmesg, grep –color, colordiff, ccze, etc can enhance their output with color, making reading a lot more pleasant. You can usually view that only on your terminal or with “less -R”; this package gives you:

  • ansi2html: convert logs to HTML
  • ansi2txt: drop ANSI control codes
  • ttyrec2ansi: drop timing data from ttyrec files
  • pipetty: makes a program think its stdout and stderr are connected to a terminal; use as a prefix: “pipetty dmesg|tee”
  • lesstty: pipe a program (as above) to “less -R”

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

sudo apt-get -y install colorized-logs

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

You can also use apt command to install colorized-logs.

sudo apt -y install colorized-logs

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

sudo aptitude install colorized-logs

Summary

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