How To Install ruby-colorize on Ubuntu 20.04

In this tutorial we learn how to install ruby-colorize on Ubuntu 20.04. ruby-colorize is color methods to Ruby String class

Introduction

In this tutorial we learn how to install ruby-colorize on Ubuntu 20.04.

What is ruby-colorize

ruby-colorize is:

This Ruby extension adds methods to the String Class to set text color, background color and text effects on the console and command line output. It is using ANSI escape sequences. Ruby-Versions: all

There are three methods to install ruby-colorize on Ubuntu 20.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 ruby-colorize Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install ruby-colorize

Install ruby-colorize Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install ruby-colorize

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

sudo aptitude -y install ruby-colorize

How To Uninstall ruby-colorize on Ubuntu 20.04

To uninstall only the ruby-colorize package we can use the following command:

sudo apt-get remove ruby-colorize

Uninstall ruby-colorize And Its Dependencies

To uninstall ruby-colorize and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove ruby-colorize

Remove ruby-colorize Configurations and Data

To remove ruby-colorize configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge ruby-colorize

Remove ruby-colorize configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge ruby-colorize

References

Summary

In this tutorial we learn how to install ruby-colorize package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.