How To Install libtest-deep-perl on Ubuntu 18.04

In this tutorial we learn how to install libtest-deep-perl on Ubuntu 18.04. libtest-deep-perl is Perl module for extremely flexible deep comparisons

Introduction

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

What is libtest-deep-perl

libtest-deep-perl is:

Test::Deep gives you very flexible ways to check that the result you got is the result you were expecting. At it’s simplest it compares two structures by going through each level, ensuring that the values match, that arrays and hashes have the same elements and that references are blessed into the correct class. It also handles circular data structures without getting caught in an infinite loop.

Where it becomes more interesting is in allowing you to do something besides simple exact comparisons. With strings, the eq operator checks that 2 strings are exactly equal but sometimes that’s not what you want. When you don’t know exactly what the string should be but you do know some things about how it should look, eq is no good and you must use pattern matching instead. Test::Deep provides pattern matching for complex data structures

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

sudo apt-get -y install libtest-deep-perl

Install libtest-deep-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libtest-deep-perl

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

sudo aptitude -y install libtest-deep-perl

How To Uninstall libtest-deep-perl on Ubuntu 18.04

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

sudo apt-get remove libtest-deep-perl

Uninstall libtest-deep-perl And Its Dependencies

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

sudo apt-get -y autoremove libtest-deep-perl

Remove libtest-deep-perl Configurations and Data

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

sudo apt-get -y purge libtest-deep-perl

Remove libtest-deep-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libtest-deep-perl

References

Summary

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