How To Install libbson-perl on Ubuntu 18.04

In this tutorial we learn how to install libbson-perl on Ubuntu 18.04. libbson-perl is BSON serialization and deserialization for Perl

Introduction

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

What is libbson-perl

libbson-perl is:

The BSON class implements a BSON encoder/decoder (“codec”). It consumes “documents” (typically hash references) and emits BSON strings and vice versa in accordance with the BSON Specification (http://bsonspec.org).

BSON is the primary data representation for MongoDB. While this module has several features that support MongoDB-specific needs and conventions, it can be used as a standalone serialization format.

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

sudo apt-get -y install libbson-perl

Install libbson-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libbson-perl

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

sudo aptitude -y install libbson-perl

How To Uninstall libbson-perl on Ubuntu 18.04

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

sudo apt-get remove libbson-perl

Uninstall libbson-perl And Its Dependencies

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

sudo apt-get -y autoremove libbson-perl

Remove libbson-perl Configurations and Data

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

sudo apt-get -y purge libbson-perl

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

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

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

References

Summary

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