How To Install libpegex-perl on Ubuntu 18.04

In this tutorial we learn how to install libpegex-perl on Ubuntu 18.04. libpegex-perl is Acmeist PEG Parser Framework

Introduction

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

What is libpegex-perl

libpegex-perl is:

Pegex is an Acmeist parser framework. It allows you to easily create parsers that will work equivalently in lots of programming languages! The inspiration for Pegex comes from the parsing engine upon which the postmodern programming language Perl 6 is based on. Pegex brings this beauty to the other justmodern languages that have a normal regular expression engine available.

Pegex gets it name by combining Parsing Expression Grammars (PEG), with Regular Expessions (Regex). That’s actually what Pegex does.

PEG is the cool new way to elegantly specify recursive descent grammars. The Perl 6 language is defined in terms of a self modifying PEG language called Perl 6 Rules. Regexes are familiar to programmers of most modern programming languages. Pegex defines a simple PEG syntax, where all the terminals are regexes. This means that Pegex can be quite fast and powerful.

Pegex attempts to be the simplest way to define new (or old) Domain Specific Languages (DSLs) that need to be used in several programming languages and environments. Things like JSON, YAML, Markdown etc. It also great for writing parsers/compilers that only need to work in one language.

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

sudo apt-get -y install libpegex-perl

Install libpegex-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libpegex-perl

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

sudo aptitude -y install libpegex-perl

How To Uninstall libpegex-perl on Ubuntu 18.04

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

sudo apt-get remove libpegex-perl

Uninstall libpegex-perl And Its Dependencies

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

sudo apt-get -y autoremove libpegex-perl

Remove libpegex-perl Configurations and Data

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

sudo apt-get -y purge libpegex-perl

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

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

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

References

Summary

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