How To Install black on Debian 10

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

Introduction

In this tutorial we learn how to install black on Debian 10.

What is black

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 ways to install black on Debian 10. 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 first since aptitude is usually not installed by default on Debian. 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 Debian 10

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 Debian 10, we can use the command below:

sudo apt-get -y autoremove black

Remove black Configurations and Data

To remove black configuration and data from Debian 10 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

References

Summary

In this tutorial we learn how to install black on Debian 10 using different package management tools like apt, apt-get and aptitude.