How To Install python3-apt on Ubuntu 20.04

In this tutorial we learn how to install python3-apt on Ubuntu 20.04. python3-apt is Python 3 interface to libapt-pkg Python 3 interface to libapt-pkg Python 3 interface to libapt-pkg Python 3 interface to libapt-pkg

Introduction

In this tutorial we learn how to install python3-apt on Ubuntu 20.04.

What is python3-apt

python3-apt is:

The apt_pkg Python 3 interface will provide full access to the internal libapt-pkg structures allowing Python 3 programs to easily perform a variety of functions, such as:

  • Access to the APT configuration system
  • Access to the APT package information database
  • Parsing of Debian package control files, and other files with a similar structure

The included ‘aptsources’ Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. Task: standard

Package: python3-apt Status: install ok installed Priority: optional Section: python Installed-Size: 715 Maintainer: Ubuntu Developers [email protected] Architecture: amd64 Multi-Arch: allowed Source: python-apt Version: 2.0.0ubuntu0.20.04.4 Replaces: python-apt (« 0.7.98+nmu1) Provides: python3.8-apt Depends: python3 (« 3.9), python3 (>= 3.8~), python3:any, libapt-pkg6.0 (>= 1.9.11~), libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2), python-apt-common Recommends: lsb-release, iso-codes Suggests: python3-apt-dbg, python-apt-doc, apt Breaks: apt-xapian-index (« 0.51~), kthresher (<= 1.4.0-1), python-apt (« 0.7.98+nmu1) Description-en: Python 3 interface to libapt-pkg The apt_pkg Python 3 interface will provide full access to the internal libapt-pkg structures allowing Python 3 programs to easily perform a variety of functions, such as:

  • Access to the APT configuration system
  • Access to the APT package information database
  • Parsing of Debian package control files, and other files with a similar structure

The included ‘aptsources’ Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. Original-Maintainer: APT Development Team [email protected]

Package: python3-apt Architecture: amd64 Version: 2.0.0ubuntu0.20.04.3 Multi-Arch: allowed Priority: standard Section: python Source: python-apt Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: APT Development Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 715 Provides: python3.8-apt Depends: python3 (« 3.9), python3 (>= 3.8~), python3:any, libapt-pkg6.0 (>= 1.9.11~), libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2), python-apt-common Recommends: lsb-release, iso-codes Suggests: python3-apt-dbg, python-apt-doc, apt Breaks: apt-xapian-index (« 0.51~), kthresher (<= 1.4.0-1), python-apt (« 0.7.98+nmu1) Replaces: python-apt (« 0.7.98+nmu1) Filename: pool/main/p/python-apt/python3-apt_2.0.0ubuntu0.20.04.3_amd64.deb Size: 154328 MD5sum: f7f5223f62ab22aa926300e1f0961c33 SHA1: 205c005100e20a1ab8e259073ac30cc096de18e2 SHA256: 675e69e7ce6712176b5854c602dfd8f10561954da34ca862e6490b81b82cd853 SHA512: 8d5f436bc03ad4ac70a31458c3c9a0ee5cc80ebfa625795eeca4a098cd720f9bc0fb287744ffd13aa4d67652609d223b385265918b14e3e1926759dafdb552fc Description-en: Python 3 interface to libapt-pkg The apt_pkg Python 3 interface will provide full access to the internal libapt-pkg structures allowing Python 3 programs to easily perform a variety of functions, such as:

  • Access to the APT configuration system
  • Access to the APT package information database
  • Parsing of Debian package control files, and other files with a similar structure

The included ‘aptsources’ Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. Task: standard

Package: python3-apt Architecture: amd64 Version: 2.0.0 Multi-Arch: allowed Priority: standard Section: python Source: python-apt Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: APT Development Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 714 Provides: python3.8-apt Depends: python3 (« 3.9), python3 (>= 3.8~), python3:any, libapt-pkg6.0 (>= 1.9.11~), libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2), python-apt-common Recommends: lsb-release, iso-codes Suggests: python3-apt-dbg, python-apt-doc, apt Breaks: apt-xapian-index (« 0.51~), kthresher (<= 1.4.0-1), python-apt (« 0.7.98+nmu1) Replaces: python-apt (« 0.7.98+nmu1) Filename: pool/main/p/python-apt/python3-apt_2.0.0_amd64.deb Size: 153772 MD5sum: 8aab416d3d24d8dd5c3700e5a718854c SHA1: 699caefed2070b2d1c544f3c4512773e00f75157 SHA256: 041a7155ad1201b4cfb59e51a1381f53af33a97f088b89cbef3bc6c69357adfb Description-en: Python 3 interface to libapt-pkg The apt_pkg Python 3 interface will provide full access to the internal libapt-pkg structures allowing Python 3 programs to easily perform a variety of functions, such as:

  • Access to the APT configuration system
  • Access to the APT package information database
  • Parsing of Debian package control files, and other files with a similar structure

The included ‘aptsources’ Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. Task: standard

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

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

sudo apt-get update

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

sudo apt-get -y install python3-apt

Install python3-apt Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python3-apt

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

sudo aptitude -y install python3-apt

How To Uninstall python3-apt on Ubuntu 20.04

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

sudo apt-get remove python3-apt

Uninstall python3-apt And Its Dependencies

To uninstall python3-apt and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove python3-apt

Remove python3-apt Configurations and Data

To remove python3-apt configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge python3-apt

Remove python3-apt configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python3-apt

References

Summary

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