netaddr command not found

In this troubleshooting guide we learn how to fix netaddr command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

netaddr: command not found

or when using sudo you get the following error message

sudo: netaddr: command not found

Solutions to netaddr: command not found

How To Fix netaddr: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu netaddr is provided by python3-netaddr package.

python3-netaddr is:

netaddr is a Python library for the manipulation of various common network address notations and representations.

It takes the hassle out of fiddling with enumerable variations of network addresses presenting a consistent, extensible, easy-to-use and (above all) Pythonic API.

With it you can validate, convert, categorise, iterate, generate, slice (and dice):

  • MAC (Media Access Control)
  • IEEE EUI-48 and EUI-64
  • IP version 4
  • IP version 6
  • CIDR (Classless Inter-Domain Routing)

This is the Python 3 version of the package.

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-netaddr

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-netaddr.

sudo apt -y install python3-netaddr

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-netaddr

Summary

In this tutorial we learn how to fix netaddr command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.