How To Install libclass-virtual-perl on Ubuntu 18.04

In this tutorial we learn how to install libclass-virtual-perl on Ubuntu 18.04. libclass-virtual-perl is Base class for virtual base classes

Introduction

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

What is libclass-virtual-perl

libclass-virtual-perl is:

This is a base class for implementing virtual base classes (what some people call an abstract class). Kinda kooky. It allows you to explicitly declare what methods are virtual and that must be implemented by subclasses. This might seem silly, since your program will halt and catch fire when an unimplemented virtual method is hit anyway, but there’s some benefits.

The error message is more informative. Instead of the usual “Can’t locate object method” error, you’ll get one explaining that a virtual method was left unimplemented.

Subclass authors can explicitly check to make sure they’ve implemented all the necessary virtual methods. When used as part of a regression test, it will shield against the virtual method requirements changing out from under the subclass.

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

sudo apt-get -y install libclass-virtual-perl

Install libclass-virtual-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libclass-virtual-perl

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

sudo aptitude -y install libclass-virtual-perl

How To Uninstall libclass-virtual-perl on Ubuntu 18.04

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

sudo apt-get remove libclass-virtual-perl

Uninstall libclass-virtual-perl And Its Dependencies

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

sudo apt-get -y autoremove libclass-virtual-perl

Remove libclass-virtual-perl Configurations and Data

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

sudo apt-get -y purge libclass-virtual-perl

Remove libclass-virtual-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libclass-virtual-perl

References

Summary

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