How To Install python-indexed-gzip on Ubuntu 18.04

In this tutorial we learn how to install python-indexed-gzip on Ubuntu 18.04. python-indexed-gzip is fast random access of gzip files in Python

Introduction

In this tutorial we learn how to install python-indexed-gzip on Ubuntu 18.04.

What is python-indexed-gzip

python-indexed-gzip is:

Drop-in replacement IndexedGzipFile for the built-in Python gzip.GzipFile class that does not need to start decompressing from the beginning of the file when for every seek(). It gets around this performance limitation by building an index, which contains seek points, mappings between corresponding locations in the compressed and uncompressed data streams. Each seek point is accompanied by a chunk (32KB) of uncompressed data which is used to initialise the decompression algorithm, allowing to start reading from any seek point. If the index is built with a seek point spacing of 1MB, only 512KB (on average) of data have to be decompressed to read from any location in the file.

This package provides the Python 2 module.

There are three methods to install python-indexed-gzip 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 python-indexed-gzip Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install python-indexed-gzip

Install python-indexed-gzip Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-indexed-gzip using apt by running the following command:

sudo apt -y install python-indexed-gzip

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

sudo aptitude -y install python-indexed-gzip

How To Uninstall python-indexed-gzip on Ubuntu 18.04

To uninstall only the python-indexed-gzip package we can use the following command:

sudo apt-get remove python-indexed-gzip

Uninstall python-indexed-gzip And Its Dependencies

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

sudo apt-get -y autoremove python-indexed-gzip

Remove python-indexed-gzip Configurations and Data

To remove python-indexed-gzip configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-indexed-gzip

Remove python-indexed-gzip configuration, data, and all of its dependencies

We can use the following command to remove python-indexed-gzip configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-indexed-gzip

References

Summary

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