How To Install libjson-parse-perl on Debian 12

Learn how to install libjson-parse-perl on Debian 12 with this tutorial. libjson-parse-perl is module to read JSON into a Perl variable

Introduction

In this tutorial we learn how to install libjson-parse-perl on Debian 12.

What is libjson-parse-perl

libjson-parse-perl is:

JSON::Parse is a module for parsing JSON.

It offers the function parse_json(), which takes a string containing JSON, and returns an equivalent Perl structure. It also offers validation of JSON via valid_json(), which returns true or false depending on whether the JSON is correct or not, and assert_valid_json(), which produces a descriptive fatal error if the JSON is invalid. A function json_file_to_perl() reads JSON from a file, and there is a safer version of parse_json() called parse_json_safe() which doesn’t throw exceptions. For special cases of parsing, there are also methods new() and run(), which create a JSON parsing object and run it on text.

JSON::Parse accepts only UTF-8 as input.

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

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

Install libjson-parse-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libjson-parse-perl

Install libjson-parse-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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install libjson-parse-perl

How To Uninstall libjson-parse-perl on Debian 12

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

sudo apt-get remove libjson-parse-perl

Uninstall libjson-parse-perl And Its Dependencies

To uninstall libjson-parse-perl and its dependencies that are no longer needed by Debian 12, we can use the command below:

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

Remove libjson-parse-perl Configurations and Data

To remove libjson-parse-perl configuration and data from Debian 12 we can use the following command:

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

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

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

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

Dependencies

libjson-parse-perl have the following dependencies:

References

Summary

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