How To Install libexpect-perl on Ubuntu 18.04

In this tutorial we learn how to install libexpect-perl on Ubuntu 18.04. libexpect-perl is Expect.pm - Perl Expect interface

Introduction

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

What is libexpect-perl

libexpect-perl is:

The Expect module is a successor of Comm.pl and a descendent of Chat.pl. It more closely resembles the Tcl Expect language than its predecessors. It does not contain any of the networking code found in Comm.pl. I suspect this would be obsolete anyway given the advent of IO::Socket and external tools such as netcat.

Expect.pm is an attempt to have more of a switch() & case: feel to make decision processing more fluid. three separate types of debugging have been implemented to make code production easier.

It is now possible to interconnect multiple file handles (and processes) much like Tcl’s expect. An attempt was made to enable all the features of Tcl’s expect without forcing Tcl on the victim programmer :-) .

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

sudo apt-get -y install libexpect-perl

Install libexpect-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libexpect-perl

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

sudo aptitude -y install libexpect-perl

How To Uninstall libexpect-perl on Ubuntu 18.04

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

sudo apt-get remove libexpect-perl

Uninstall libexpect-perl And Its Dependencies

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

sudo apt-get -y autoremove libexpect-perl

Remove libexpect-perl Configurations and Data

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

sudo apt-get -y purge libexpect-perl

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

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

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

References

Summary

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