How To Install python2-distro on CentOS 7
Introduction
In this tutorial we learn how to install python2-distro
on CentOS 7.
What is python2-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 2 version.
We can use yum
or dnf
to install python2-distro
on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python2-distro.
Install python2-distro on CentOS 7 Using yum
Update yum database with yum
using the following command.
After updating yum database, We can install python2-distro
using yum
by running the following command:
Install python2-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.
After updating yum database, We can install python2-distro
using dnf
by running the following command:
How To Uninstall python2-distro on CentOS 7
To uninstall only the python2-distro
package we can use the following command:
References
Summary
In this tutorial we learn how to install python2-distro
on CentOS 7 using yum
and dnf
.