How To Install libdata-yaml-perl on Ubuntu 18.04

In this tutorial we learn how to install libdata-yaml-perl on Ubuntu 18.04. libdata-yaml-perl is Easy YAML serialisation of Perl data structures

Introduction

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

What is libdata-yaml-perl

libdata-yaml-perl is:

In the spirit of YAML::Tiny, Data::YAML::Reader and Data::YAML::Writer provide lightweight, dependency-free YAML handling. While YAML::Tiny is designed principally for working with configuration files Data::YAML concentrates on the transparent round-tripping of YAML serialized Perl data structures.

As an example of why this distinction matters consider that YAML::Tiny doesn’t handle hashes with keys containing non-printable characters. This is fine for configuration files but likely to cause problems when handling arbitrary Perl data structures. Data::YAML handles exotic hash keys correctly.

The syntax accepted by Data::YAML is a subset of YAML. Specifically it is the same subset of YAML that Data::YAML::Writer produces. See Data::YAML for more information.

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

sudo apt-get -y install libdata-yaml-perl

Install libdata-yaml-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libdata-yaml-perl

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

sudo aptitude -y install libdata-yaml-perl

How To Uninstall libdata-yaml-perl on Ubuntu 18.04

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

sudo apt-get remove libdata-yaml-perl

Uninstall libdata-yaml-perl And Its Dependencies

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

sudo apt-get -y autoremove libdata-yaml-perl

Remove libdata-yaml-perl Configurations and Data

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

sudo apt-get -y purge libdata-yaml-perl

Remove libdata-yaml-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libdata-yaml-perl

References

Summary

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