How To Install python36-distro on CentOS 7

In this tutorial we learn how to install python36-distro on CentOS 7. python36-distro is Linux Distribution - a Linux OS platform information API

Introduction

In this tutorial we learn how to install python36-distro on CentOS 7.

What is python36-distro

The distro (for about the 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 python36-distro on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python36-distro.

Install python36-distro on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python36-distro

Install python36-distro on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install python36-distro

How To Uninstall python36-distro on CentOS 7

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

sudo dnf remove python36-distro

References

Summary

In this tutorial we learn how to install python36-distro on CentOS 7 using yum and dnf.