How To Install libyojson-ocaml on Ubuntu 18.04

In this tutorial we learn how to install libyojson-ocaml on Ubuntu 18.04. libyojson-ocaml is JSON library for OCaml - runtime package

Introduction

In this tutorial we learn how to install libyojson-ocaml on Ubuntu 18.04.

What is libyojson-ocaml

libyojson-ocaml is:

Yojson is an optimized parsing and printing library for the JSON format. It addresses a few shortcomings of json-wheel including 3x speed improvement, polymorphic variants and optional syntax for tuples and variants.

It is a replacement for json-wheel (libjson-wheel-ocaml-dev).

This package contains the shared runtime libraries.

There are three methods to install libyojson-ocaml 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 libyojson-ocaml Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libyojson-ocaml using apt-get by running the following command:

sudo apt-get -y install libyojson-ocaml

Install libyojson-ocaml Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libyojson-ocaml

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

sudo aptitude -y install libyojson-ocaml

How To Uninstall libyojson-ocaml on Ubuntu 18.04

To uninstall only the libyojson-ocaml package we can use the following command:

sudo apt-get remove libyojson-ocaml

Uninstall libyojson-ocaml And Its Dependencies

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

sudo apt-get -y autoremove libyojson-ocaml

Remove libyojson-ocaml Configurations and Data

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

sudo apt-get -y purge libyojson-ocaml

Remove libyojson-ocaml configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge libyojson-ocaml

References

Summary

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