How To Install libdevel-declare-perl on Ubuntu 18.04

In this tutorial we learn how to install libdevel-declare-perl on Ubuntu 18.04. libdevel-declare-perl is module to add new syntax to Perl

Introduction

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

What is libdevel-declare-perl

libdevel-declare-perl is:

Devel::Declare can install subroutines called declarators which locally take over control of Perl’s parser, allowing the creation of new syntax, including keywords and other constructs that might not be, in themselves, valid Perl 5 code.

This module can be used for adding new keywords, completely in Perl code. It allows a subroutine to be executed during the Perl code compilation, meaning that syntax can be transformed into equivalent code for Perl on-the-fly.

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

sudo apt-get -y install libdevel-declare-perl

Install libdevel-declare-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libdevel-declare-perl

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

sudo aptitude -y install libdevel-declare-perl

How To Uninstall libdevel-declare-perl on Ubuntu 18.04

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

sudo apt-get remove libdevel-declare-perl

Uninstall libdevel-declare-perl And Its Dependencies

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

sudo apt-get -y autoremove libdevel-declare-perl

Remove libdevel-declare-perl Configurations and Data

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

sudo apt-get -y purge libdevel-declare-perl

Remove libdevel-declare-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libdevel-declare-perl

References

Summary

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