How To Install libperlx-assert-perl on Ubuntu 18.04

In this tutorial we learn how to install libperlx-assert-perl on Ubuntu 18.04. libperlx-assert-perl is yet another assertion keyword

Introduction

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

What is libperlx-assert-perl

libperlx-assert-perl is:

PerlX::Assert is a framework for embedding assertions in Perl code. Under normal circumstances, assertions are not checked; they are optimized away at compile time.

However if, at compile time, any of the following environment variables is true, assertions are checked, and if they fail, throw an exception.

  • PERL_STRICT
  • AUTHOR_TESTING
  • EXTENDED_TESTING
  • RELEASE_TESTING

That is, assertions will only typically be checked when the test suite is being run on the authors’ machine, or otherwise opted into.

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

sudo apt-get -y install libperlx-assert-perl

Install libperlx-assert-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libperlx-assert-perl

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

sudo aptitude -y install libperlx-assert-perl

How To Uninstall libperlx-assert-perl on Ubuntu 18.04

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

sudo apt-get remove libperlx-assert-perl

Uninstall libperlx-assert-perl And Its Dependencies

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

sudo apt-get -y autoremove libperlx-assert-perl

Remove libperlx-assert-perl Configurations and Data

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

sudo apt-get -y purge libperlx-assert-perl

Remove libperlx-assert-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libperlx-assert-perl

References

Summary

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