decolor command not found

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

Introduction

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

decolor: command not found

or when using sudo you get the following error message

sudo: decolor: command not found

Solutions to decolor: command not found

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

In Ubuntu decolor is provided by ruby-term-ansicolor package.

ruby-term-ansicolor is:

Small Ruby library that colors strings using ANSI escape sequences. It’s possible to use constants or unary functions. Block-forms also autoreset at the block’s end. It’s also possible to use this module as a mixin for classes of objects that respond to :to_str, e.g. String.

This package is part of the Ruby library extras, a supplement to Ruby’s standard library.

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

sudo apt-get -y install ruby-term-ansicolor

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

You can also use apt command to install ruby-term-ansicolor.

sudo apt -y install ruby-term-ansicolor

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

sudo aptitude install ruby-term-ansicolor

Summary

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