Development

How to Install NMAP on Ubuntu

Captain Salem 2 min read

How to Install NMAP on Ubuntu

Nmap, short for Network Mapper, is an open-source network discovery, scanning, and security auditing tool. System administrators and network engineers widely use it to evaluate network security, manage inventory, and monitor service uptime.

Nmap accomplishes its tasks by sending specially crafted packets to target hosts and analyzing the responses. This allows Nmap to gather information about the target network and its devices, such as open ports, operating systems, and services.

In this tutorial, we will show you how you to install the latest Nmap tool on your Ubuntu system using various methods.

Requirements

  1. Ubuntu System
  2. Terminal Access
  3. Sudo permissions
  4. A working network connection

We have tested this tutorial on Ubuntu 20.04 and Ubuntu 22.04.

Step 1 - Refresh Ubuntu Package List

Start by updating the Ubuntu package list with the command:

sudo apt-get update

Output:

Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [728 
Fetched 26.6 MB in 23s (1152 kB/s)
Reading package lists... Done

Once the package lists are up to date, install Nmap on Ubuntu.

Step 2 - Install Nmap

To install Nmap, run the command:

sudo apt-get install nmap -y

Step 3 - Verify Nmap is Installed

You can verify Nmap is installed and running on your machine by checking the version as shown in the command below:

nmap --version

Output:

Nmap version 7.80 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.6 openssl-3.0.2 nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.10.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

Installing Nmap Using DPKG

If you do not wish to use apt to install the Nmap package, you can download the deb package from the link below:

https://packages.debian.org/stable/nmap

For example, run the command:

wget http://ftp.us.debian.org/debian/pool/main/n/nmap/nmap_7.91+dfsg1+really7.80+dfsg1-2_amd64.deb

Once downloaded, install the package with dpkg as shown:

sudo dpkg -i nmap_7.91+dfsg1+really7.80+dfsg1-2_amd64.deb

The command above should use dpkg to install and configure Nmap on your machine.

Conclusion

Having learned how to install and utilize Nmap on Ubuntu, you are now equipped with the knowledge to employ this versatile and potent scanning tool efficiently. Its installation process is straightforward, rendering it an easily accessible option.

Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.