How To Install liberror-perl on Ubuntu 18.04

In this tutorial we learn how to install liberror-perl on Ubuntu 18.04. liberror-perl is Perl module for error/exception handling in an OO-ish way

Introduction

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

What is liberror-perl

liberror-perl is:

The Error module provides two interfaces. Firstly “Error” provides a procedural interface to exception handling. Secondly “Error” is a base class for errors/exceptions that can either be thrown, for subsequent catch, or can simply be recorded.

Errors in the class “Error” should not be thrown directly, but the user should throw errors from a sub-class of “Error”.

Warning: Using the “Error” module is no longer recommended due to the black-magical nature of its syntactic sugar, which often tends to break. Its maintainers have stopped actively writing code that uses it, and discourage people from doing so.

Recommended alternatives are Exception::Class (libexception-class-perl), Error::Exception (not packaged), TryCatch (libtrycatch-perl), and Try::Tiny (libtry-tiny-perl).

There are three methods to install liberror-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 liberror-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 liberror-perl using apt-get by running the following command:

sudo apt-get -y install liberror-perl

Install liberror-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install liberror-perl

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

sudo aptitude -y install liberror-perl

How To Uninstall liberror-perl on Ubuntu 18.04

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

sudo apt-get remove liberror-perl

Uninstall liberror-perl And Its Dependencies

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

sudo apt-get -y autoremove liberror-perl

Remove liberror-perl Configurations and Data

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

sudo apt-get -y purge liberror-perl

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

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

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

References

Summary

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