How To Install python-netaddr on CentOS 7

In this tutorial we learn how to install python-netaddr on CentOS 7. python-netaddr is A pure Python network address representation and manipulation

Introduction

In this tutorial we learn how to install python-netaddr on CentOS 7.

What is python-netaddr

A pure Python network address representation and manipulation library. netaddr provides a Pythonic way of working with - IPv4 and IPv6 addresses and subnets - MAC addresses, OUI and IAB identifiers, IEEE EUI-64 identifiers - arbitrary (non-aligned) IP address ranges and IP address sets - various non-CIDR IP range formats such as nmap and glob-style formats Included are routines for - generating, sorting and summarizing IP addresses and networks - performing easy conversions between address notations and formats - detecting, parsing and formatting network address representations - performing set-based operations on groups of IP addresses and subnets - working with arbitrary IP address ranges and formats - accessing OUI and IAB organisational information published by IEEE - accessing IP address and block information published by IANA For details on the latest updates and changes, see http API documentation for the latest release is available here http

We can use yum or dnf to install python-netaddr on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python-netaddr.

Install python-netaddr on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python-netaddr

Install python-netaddr 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 python-netaddr using dnf by running the following command:

sudo dnf -y install python-netaddr

How To Uninstall python-netaddr on CentOS 7

To uninstall only the python-netaddr package we can use the following command:

sudo dnf remove python-netaddr

References

Summary

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