How To Install libjson-validator-perl on Ubuntu 18.04

In this tutorial we learn how to install libjson-validator-perl on Ubuntu 18.04. libjson-validator-perl is module to validate data against a JSON schema

Introduction

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

What is libjson-validator-perl

libjson-validator-perl is:

JSON::Validator is a class for validating data against JSON schemas. You might want to use this instead of JSON::Schema if you need to validate data against draft 4 of the JSON schema specification.

JSON::Validator can load JSON schemas in multiple formats: Plain perl data structured or files on disk/web in the JSON/YAML format. The JSON parsing is done using Mojo::JSON, while the YAML parsing is done with an optional modules which need to be installed manually. JSON::Validator will look for the YAML modules in this order: YAML::XS, YAML::Syck. The order is set by which module that performs the best, so it might change in the future.

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

sudo apt-get -y install libjson-validator-perl

Install libjson-validator-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libjson-validator-perl

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

sudo aptitude -y install libjson-validator-perl

How To Uninstall libjson-validator-perl on Ubuntu 18.04

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

sudo apt-get remove libjson-validator-perl

Uninstall libjson-validator-perl And Its Dependencies

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

sudo apt-get -y autoremove libjson-validator-perl

Remove libjson-validator-perl Configurations and Data

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

sudo apt-get -y purge libjson-validator-perl

Remove libjson-validator-perl configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libjson-validator-perl

References

Summary

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