How to Install Nmap on Ubuntu

In this article, we will see how to Install Nmap on Ubuntu step by step. The nmap installation process same for all Ubuntu versions.

Nmap (“Network Mapper”) is a free and open source utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

Install nmap on Ubuntu 22.04

Prerequisites to install nmap on Ubuntu:
sudo privileges.

1. Update the package index on Ubuntu using the below command.

sudo apt-get update

How to Install Nmap on Ubuntu

2. Install the nmap on Ubuntu using below command.

sudo apt-get install nmap

Type y and hit enter to continue.

Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libflashrom1 libftdi1-2 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libblas3 liblinear4 lua-lpeg nmap-common Suggested packages: liblinear-tools liblinear-dev ncat ndiff zenmap The following NEW packages will be installed: libblas3 liblinear4 lua-lpeg nmap nmap-common 0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded. 1 not fully installed or removed. Need to get 5,972 kB of archives. After this operation, 26.3 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 libblas3 amd64 3.10.0-2ubuntu1 [228 kB] Get:2 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 liblinear4 amd64 2.3.0+dfsg-5 [41.4 kB] Get:3 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 lua-lpeg amd64 1.0.2-1 [31.4 kB] Get:4 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 nmap-common all 7.91+dfsg1+really7.80+dfsg1-2build1 [3,940 kB] Get:5 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 nmap amd64 7.91+dfsg1+really7.80+dfsg1-2build1 [1,731 kB] Fetched 5,972 kB in 3s (1,810 kB/s) Selecting previously unselected package libblas3:amd64. (Reading database ... 210802 files and directories currently installed.) Preparing to unpack .../libblas3_3.10.0-2ubuntu1_amd64.deb ... Unpacking libblas3:amd64 (3.10.0-2ubuntu1) ... Selecting previously unselected package liblinear4:amd64. Preparing to unpack .../liblinear4_2.3.0+dfsg-5_amd64.deb ... Unpacking liblinear4:amd64 (2.3.0+dfsg-5) ... Selecting previously unselected package lua-lpeg:amd64. Preparing to unpack .../lua-lpeg_1.0.2-1_amd64.deb ... Unpacking lua-lpeg:amd64 (1.0.2-1) ... Selecting previously unselected package nmap-common. Preparing to unpack .../nmap-common_7.91+dfsg1+really7.80+dfsg1-2build1_all.deb ... Unpacking nmap-common (7.91+dfsg1+really7.80+dfsg1-2build1) ... Selecting previously unselected package nmap. Preparing to unpack .../nmap_7.91+dfsg1+really7.80+dfsg1-2build1_amd64.deb ... Unpacking nmap (7.91+dfsg1+really7.80+dfsg1-2build1) ... Setting up lua-lpeg:amd64 (1.0.2-1) ... Setting up jenkins (2.375.1) ... Setting up libblas3:amd64 (3.10.0-2ubuntu1) ... update-alternatives: using /usr/lib/x86_64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode Setting up nmap-common (7.91+dfsg1+really7.80+dfsg1-2build1) ... Setting up liblinear4:amd64 (2.3.0+dfsg-5) ... Setting up nmap (7.91+dfsg1+really7.80+dfsg1-2build1) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

3. Now, verify nmap version by running the below command.

nmap --version

Nmap examples:

1. Check for open ports for the ip 192.168.106.142 using nmap

sudo nmap -sS 192.168.106.142

2. Let Nmap to find the operating system of the target.

sudo nmap -O --osscan-guess 192.168.106.142

3. Find the services running on target ip using nmap.

sudo nmap -sV 192.168.106.142

So in this article, we have seen how to install nmap on Ubuntu and performed few exampkes of nmap.

Video tutorial to install nmap on Ubuntu:

Leave a Reply

Your email address will not be published. Required fields are marked *