How To Install python3-distro on AlmaLinux 8

In this tutorial we learn how to install python3-distro in AlmaLinux 8. python3-distro is Linux Distribution - a Linux OS platform information API

Introduction

In this tutorial we learn how to install python3-distro on AlmaLinux 8.

What is python3-distro

The distro (for Linux distribution it runs on, such as a reliable machine-readable ID, or version information. It is a renewed alternative implementation for Python’s original platform.linux_distribution function, but it also provides much more functionality. An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.7 is expected to remove it altogether. Its predecessor function platform.dist was already deprecated since Python 2.6 and is also expected to be removed in Python 3.7. Still, there are many cases in which access to that information is needed. See Python issue 1322 for more information. Python 3 version.

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

Install python3-distro on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install python3-distro

Install python3-distro on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install python3-distro

How To Uninstall python3-distro on AlmaLinux 8

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

sudo dnf remove python3-distro

References

Summary

In this tutorial we learn how to install python3-distro on AlmaLinux 8 using yum and dnf.