How To Install python-apt-dev on Debian 11

In this tutorial we learn how to install python-apt-dev on Debian 11. python-apt-dev is Python interface to libapt-pkg (development files)

Introduction

In this tutorial we learn how to install python-apt-dev on Debian 11.

What is python-apt-dev

python-apt-dev is:

The apt_pkg Python interface will provide full access to the internal libapt-pkg structures allowing Python programs to easily perform a variety of functions.

This package contains the header files needed to use python-apt objects from C++ applications.

There are three methods to install python-apt-dev on Debian 11. 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-apt-dev 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-apt-dev using apt-get by running the following command:

sudo apt-get -y install python-apt-dev

Install python-apt-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-apt-dev

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

sudo aptitude -y install python-apt-dev

How To Uninstall python-apt-dev on Debian 11

To uninstall only the python-apt-dev package we can use the following command:

sudo apt-get remove python-apt-dev

Uninstall python-apt-dev And Its Dependencies

To uninstall python-apt-dev and its dependencies that are no longer needed by Debian 11, we can use the command below:

sudo apt-get -y autoremove python-apt-dev

Remove python-apt-dev Configurations and Data

To remove python-apt-dev configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge python-apt-dev

Remove python-apt-dev configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python-apt-dev

Dependencies

python-apt-dev have the following dependencies:

References

Summary

In this tutorial we learn how to install python-apt-dev package on Debian 11 using different package management tools: apt, apt-get and aptitude.