nmap command not found

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

Introduction

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

nmap: command not found

or when using sudo you get the following error message

sudo: nmap: command not found

Solutions to nmap: command not found

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

In Ubuntu nmap is provided by nmap package.

nmap is:

Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques, version detection (determine service protocols and application versions listening behind ports), and TCP/IP fingerprinting (remote host OS or device identification). Nmap also offers flexible target and port specification, decoy/stealth scanning, sunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and commandline modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ.

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

sudo apt-get -y install nmap

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

You can also use apt command to install nmap.

sudo apt -y install nmap

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

sudo aptitude install nmap

Summary

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