How To Install badger on Ubuntu 22.04

In this tutorial we learn how to install badger on Ubuntu 22.04. badger is Fast key-value DB in Go.

Introduction

In this tutorial we learn how to install badger on Ubuntu 22.04.

What is badger

badger is:

BadgerDB is an embeddable, persistent and fast key-value (KV) database written in pure Go. It is the underlying database for Dgraph (https://dgraph.io), a fast, distributed graph database. It’s meant to be a performant alternative to non-Go-based key-value stores like RocksDB. Project Status [Jun 26, 2019] Badger is stable and is being used to serve data sets worth hundreds of terabytes. Badger supports concurrent ACID transactions with serializable snapshot isolation (SSI) guarantees. A Jepsen-style bank test runs nightly for 8h, with –race flag and ensures the maintenance of transactional guarantees. Badger has also been tested to work with filesystem level anomalies, to ensure persistence and consistency.

Badger v1.0 was released in Nov 2017, and the latest version that is data-compatible with v1.0 is v1.6.0.

Badger v2.0, use a new storage format which won’t be compatible with all of the v1.x.

There are three methods to install badger on Ubuntu 22.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 badger Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install badger

Install badger Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install badger using apt by running the following command:

sudo apt -y install badger

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

sudo aptitude -y install badger

How To Uninstall badger on Ubuntu 22.04

To uninstall only the badger package we can use the following command:

sudo apt-get remove badger

Uninstall badger And Its Dependencies

To uninstall badger and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove badger

Remove badger Configurations and Data

To remove badger configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge badger

Remove badger configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge badger

References

Summary

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