How To Install libio-capture-perl on Ubuntu 18.04

In this tutorial we learn how to install libio-capture-perl on Ubuntu 18.04. libio-capture-perl is Abstract Base Class to build modules to capture output

Introduction

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

What is libio-capture-perl

libio-capture-perl is:

The IO::Capture Module defines an abstract base class that can be used to build modules that capture output being sent on a filehandle such as STDOUT or STDERR.

Several modules that come with the distribution do just that. I.e., Capture STDOUT and STDERR. Also see James Keenan’s IO::Capture::Stdout::Extended on CPAN.

See IO::Capture::Overview for a discussion of these modules and examples of how to build a module to sub-class from IO::Capture yourself. If after reading the overview, you would like to build a class from IO::Capture, look here for details on the internals.

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

sudo apt-get -y install libio-capture-perl

Install libio-capture-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libio-capture-perl

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

sudo aptitude -y install libio-capture-perl

How To Uninstall libio-capture-perl on Ubuntu 18.04

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

sudo apt-get remove libio-capture-perl

Uninstall libio-capture-perl And Its Dependencies

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

sudo apt-get -y autoremove libio-capture-perl

Remove libio-capture-perl Configurations and Data

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

sudo apt-get -y purge libio-capture-perl

Remove libio-capture-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libio-capture-perl

References

Summary

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