How To Install python3-apt on Fedora 36

In this tutorial we learn how to install python3-apt in Fedora 36. python3-apt is Python 3 bindings for APT

Introduction

In this tutorial we learn how to install python3-apt on Fedora 36.

What is python3-apt

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.

We can use yum or dnf to install python3-apt on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install python3-apt.

Install python3-apt on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install python3-apt

Install python3-apt on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install python3-apt

How To Uninstall python3-apt on Fedora 36

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

sudo dnf remove python3-apt

python3-apt Package Contents on Fedora 36

/usr/lib/.build-id
/usr/lib/.build-id/64
/usr/lib/.build-id/64/85f53a9b328b6bc0b26d81c506e8e824544e12
/usr/lib/.build-id/94
/usr/lib/.build-id/94/3d3ffd2d3125d6bf0c34392ceef1d4899372c1
/usr/lib64/python3.10/site-packages/apt
/usr/lib64/python3.10/site-packages/apt/__init__.py
/usr/lib64/python3.10/site-packages/apt/__pycache__
/usr/lib64/python3.10/site-packages/apt/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/__init__.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/auth.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/auth.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/cache.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/cache.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/cdrom.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/cdrom.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/debfile.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/debfile.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/package.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/package.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/utils.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/__pycache__/utils.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/auth.py
/usr/lib64/python3.10/site-packages/apt/cache.py
/usr/lib64/python3.10/site-packages/apt/cdrom.py
/usr/lib64/python3.10/site-packages/apt/debfile.py
/usr/lib64/python3.10/site-packages/apt/package.py
/usr/lib64/python3.10/site-packages/apt/progress
/usr/lib64/python3.10/site-packages/apt/progress/__init__.py
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/__init__.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/base.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/base.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/text.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/apt/progress/__pycache__/text.cpython-310.pyc
/usr/lib64/python3.10/site-packages/apt/progress/base.py
/usr/lib64/python3.10/site-packages/apt/progress/text.py
/usr/lib64/python3.10/site-packages/apt/py.typed
/usr/lib64/python3.10/site-packages/apt/utils.py
/usr/lib64/python3.10/site-packages/apt_inst.cpython-310-x86_64-linux-gnu.so
/usr/lib64/python3.10/site-packages/apt_pkg.cpython-310-x86_64-linux-gnu.so
/usr/lib64/python3.10/site-packages/aptsources
/usr/lib64/python3.10/site-packages/aptsources/__init__.py
/usr/lib64/python3.10/site-packages/aptsources/__pycache__
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/__init__.cpython-310.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/distinfo.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/distinfo.cpython-310.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/distro.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/distro.cpython-310.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/sourceslist.cpython-310.opt-1.pyc
/usr/lib64/python3.10/site-packages/aptsources/__pycache__/sourceslist.cpython-310.pyc
/usr/lib64/python3.10/site-packages/aptsources/distinfo.py
/usr/lib64/python3.10/site-packages/aptsources/distro.py
/usr/lib64/python3.10/site-packages/aptsources/sourceslist.py
/usr/lib64/python3.10/site-packages/python_apt-2.3.0-py3.10.egg-info
/usr/lib64/python3.10/site-packages/python_apt-2.3.0-py3.10.egg-info/PKG-INFO
/usr/lib64/python3.10/site-packages/python_apt-2.3.0-py3.10.egg-info/SOURCES.txt
/usr/lib64/python3.10/site-packages/python_apt-2.3.0-py3.10.egg-info/dependency_links.txt
/usr/lib64/python3.10/site-packages/python_apt-2.3.0-py3.10.egg-info/top_level.txt
/usr/share/doc/python3-apt
/usr/share/doc/python3-apt/README.md
/usr/share/licenses/python3-apt
/usr/share/licenses/python3-apt/COPYING.GPL
/usr/share/python-apt
/usr/share/python-apt/templates
/usr/share/python-apt/templates/Blankon.info
/usr/share/python-apt/templates/Blankon.mirrors
/usr/share/python-apt/templates/Debian.info
/usr/share/python-apt/templates/Debian.mirrors
/usr/share/python-apt/templates/Kali.info
/usr/share/python-apt/templates/Kali.mirrors
/usr/share/python-apt/templates/Tanglu.info
/usr/share/python-apt/templates/Tanglu.mirrors
/usr/share/python-apt/templates/Ubuntu.info
/usr/share/python-apt/templates/Ubuntu.mirrors
/usr/share/python-apt/templates/gNewSense.info
/usr/share/python-apt/templates/gNewSense.mirrors

References

Summary

In this tutorial we learn how to install python3-apt on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).