How To Install libfortune-perl on Ubuntu 18.04

In this tutorial we learn how to install libfortune-perl on Ubuntu 18.04. libfortune-perl is Perl module to read fortune (strfile) databases

Introduction

In this tutorial we learn how to install libfortune-perl on Ubuntu 18.04.

What is libfortune-perl

libfortune-perl is:

The fortune program is a small but important part of the Unix culture, and this module aims to provide support for its “fortune cookie” databases to Perl programmes.

For efficiency, all versions of fortune rely on a binary header consisting mainly of offsets into the fortune file proper.

Modern versions of fortune keep this header in a separate file, and this is the style adopted by the Fortune module; the older style of munging the header and data into one large “compiled” file is not (currently) supported.

There are three methods to install libfortune-perl on Ubuntu 18.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 libfortune-perl Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install libfortune-perl

Install libfortune-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libfortune-perl

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

sudo aptitude -y install libfortune-perl

How To Uninstall libfortune-perl on Ubuntu 18.04

To uninstall only the libfortune-perl package we can use the following command:

sudo apt-get remove libfortune-perl

Uninstall libfortune-perl And Its Dependencies

To uninstall libfortune-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libfortune-perl

Remove libfortune-perl Configurations and Data

To remove libfortune-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libfortune-perl

Remove libfortune-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libfortune-perl

References

Summary

In this tutorial we learn how to install libfortune-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.