How To Install black on Kali Linux

In this tutorial we learn how to install black on Kali Linux. black is uncompromising Python code formatter (Python 3)

Introduction

In this tutorial we learn how to install black on Kali Linux.

What is black

black is:

Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.

Blackened code looks the same regardless of the project you’re reading. Formatting becomes transparent after a while and you can focus on the content instead.

Black makes code review faster by producing the smallest diffs possible.

There are three methods to install black on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install black Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install black

Install black Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install black

Install black Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install black

How To Uninstall black on Kali Linux

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

sudo apt-get remove black

Uninstall black And Its Dependencies

To uninstall black and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove black

Remove black Configurations and Data

To remove black configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge black

Remove black configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge black

Dependencies

black have the following dependencies:

References

Summary

In this tutorial we learn how to install black package on Kali Linux using different package management tools: apt, apt-get and aptitude.