How To Install libtime-period-perl on Ubuntu 18.04

In this tutorial we learn how to install libtime-period-perl on Ubuntu 18.04. libtime-period-perl is Perl library for testing if a time() is in a specific period

Introduction

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

What is libtime-period-perl

libtime-period-perl is:

The Time::Period library provides a function which tells whether a specific time falls within a specified time period. Its syntax for specifying time periods allows you to test for conditions like “Monday to Friday, 9am till 5pm” and “on the second Tuesday of the month” and “between 4pm and 4:15pm” and “in the first half of each minute” and “in January of 1998”.

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

sudo apt-get -y install libtime-period-perl

Install libtime-period-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libtime-period-perl

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

sudo aptitude -y install libtime-period-perl

How To Uninstall libtime-period-perl on Ubuntu 18.04

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

sudo apt-get remove libtime-period-perl

Uninstall libtime-period-perl And Its Dependencies

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

sudo apt-get -y autoremove libtime-period-perl

Remove libtime-period-perl Configurations and Data

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

sudo apt-get -y purge libtime-period-perl

Remove libtime-period-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libtime-period-perl

References

Summary

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