How To Install librelative-perl on Ubuntu 18.04

In this tutorial we learn how to install librelative-perl on Ubuntu 18.04. librelative-perl is Load modules with relative names

Introduction

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

What is librelative-perl

librelative-perl is:

This module allows you to load modules using only parts of their name, relatively to the current module or to a given module. Module names are by default searched below the current module, but can be searched upper in the hierarchy using the ..:: syntax.

In order to further loosen the namespace coupling, import returns the full names of the loaded modules, making object-oriented code easier to write:

use relative;

my ($Maker, $Publisher) = import relative qw(Create Publish);
my $report    = $Maker->new;
my $publisher = $Publisher->new;

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

sudo apt-get -y install librelative-perl

Install librelative-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install librelative-perl

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

sudo aptitude -y install librelative-perl

How To Uninstall librelative-perl on Ubuntu 18.04

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

sudo apt-get remove librelative-perl

Uninstall librelative-perl And Its Dependencies

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

sudo apt-get -y autoremove librelative-perl

Remove librelative-perl Configurations and Data

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

sudo apt-get -y purge librelative-perl

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

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

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

References

Summary

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