How To Install libsub-current-perl on Ubuntu 18.04

In this tutorial we learn how to install libsub-current-perl on Ubuntu 18.04. libsub-current-perl is Perl module to determine the executing subroutine

Introduction

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

What is libsub-current-perl

libsub-current-perl is:

Sub::Current provides a fairly magical function called ROUTINE() which returns a code reference pointing at the currently executing subroutine. It does not make sense to use this inside a special block (such as BEGIN, END, UNITCHECK, CHECK or INIT) or at the top level of a program, so ROUTINE will return undef.

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

sudo apt-get -y install libsub-current-perl

Install libsub-current-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libsub-current-perl

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

sudo aptitude -y install libsub-current-perl

How To Uninstall libsub-current-perl on Ubuntu 18.04

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

sudo apt-get remove libsub-current-perl

Uninstall libsub-current-perl And Its Dependencies

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

sudo apt-get -y autoremove libsub-current-perl

Remove libsub-current-perl Configurations and Data

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

sudo apt-get -y purge libsub-current-perl

Remove libsub-current-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libsub-current-perl

References

Summary

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