How To Install libtest-mockdbi-perl on Kali Linux

In this tutorial we learn how to install libtest-mockdbi-perl on Kali Linux. libtest-mockdbi-perl is mocked DBI interface for testing purposes

Introduction

In this tutorial we learn how to install libtest-mockdbi-perl on Kali Linux.

What is libtest-mockdbi-perl

libtest-mockdbi-perl is:

Test::MockDBI has a major advantage over DBI::trace() or DBD::Mock – Test::MockDBI lets you change how the mocked DBI functions behave, along with modifying what data is returned by the mocked DBI functions. These changes and modifications can be made specific to particular SQL statement patterns.

This ability to modify DBI function behavior and DBI-returned data makes it easier to test code that has different branches for different DBI behaviors – you can test that a failure within DBI or returned DB data that is different than normal is processed correctly by your module or program. If you are taking over a large code base, Test::MockDBI will help in understanding the code by allowing you to safely check how the code behaves under different database conditions without modifying any databases (production or otherwise).

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

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

Install libtest-mockdbi-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libtest-mockdbi-perl

Install libtest-mockdbi-perl Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install libtest-mockdbi-perl

How To Uninstall libtest-mockdbi-perl on Kali Linux

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

sudo apt-get remove libtest-mockdbi-perl

Uninstall libtest-mockdbi-perl And Its Dependencies

To uninstall libtest-mockdbi-perl and its dependencies that are no longer needed by Kali Linux, we can use the command below:

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

Remove libtest-mockdbi-perl Configurations and Data

To remove libtest-mockdbi-perl configuration and data from Kali Linux we can use the following command:

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

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

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

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

Dependencies

libtest-mockdbi-perl have the following dependencies:

References

Summary

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