How To Install NMAP On Ubuntu 20.04 LTS and Other Distro

Nmap is one of the most popular free and open-source command-line utility network scannings. Nmap can be used to discover hosts and service use by the system on the same network.

It is available in all major operating system such as Windows, Linux, and macOS. There is another nmap product known as zenmap, which is GUI based version of nmap.

Today we guide you on installing nmap in all major Linux distribution from source, snap, and package manager.

Prerequisites

  • Privilege sudo user
  • Package Manager

Installation From the Official Repository

We will show you how to install NMAP on all the Linux Distributions. Before that, you should update your package manager.

For Debian and Ubuntu User

To install nmap on Debian/Ubuntu System type or copy-paste the below command on your terminal:

$ sudo apt-get install nmap

For Centos/RHEL, and Fedora User

To install nmap on CentOS/RHEL System type the command:

$ sudo yum install nmap
$ sudo dnf install nmap

For Arch Linux User

It is also simple to install nmap on Arch Linux using pacman command.To install type the command:

$ sudo pacman -Sy nmap

For OpenSUSE User

If you are using OpenSUSE Leap 15.0, Leap 42.3 then the installation is pretty simple, To install nmap on OpenSUSE System type or copy-paste the below command on your terminal:

zypper install nmap

Using above command will give you the older version of nmap you can install nmap from snap or from the Official source package.

Install Nmap using Snap

You can also install nmap using the snap package, and If you are using the official package manager of fedora or any other you have to wait for a month to get an update into official repository,

Installation of Nmap is simple before that you should install snap service in your Linux system

To install snap on your Linux system you can read this article How to install the official Snap Store on Ubuntu, Arch, Manjaro, CentOS, Fedora

After that you have to type command or do copy-paste

$ sudo snap install nmap

From the Official Source Code

If you don’t want to use snap to install nmap on your Linux Based then you can download source code from the Official site and Install.

To install nmap from source will take a couple of extra command from Official or Snap version.

Step 1. To Download the latest nmap version go to the Nmap Download Page and scroll down, go to the Source Code Distribution section and copy the link address.

Download nmap from official source code

Step 2. In this step we use wget command to download source code.

$ wget https://nmap.org/dist/nmap-7.91.tar.bz2

It will take some seconds to download.

Step 3. Now we will extract the tar file and using cd command will go to the extracted folder

$ bzip2 -cd nmap-7.91.tar.bz2 | tar xvf -

Step 4. We will configure,compile and install file in a couple of command.

First, type a command and wait till it checks all the libraries or dependencies are available which is required to install.

$ ./configure

If you ./configure file able to check all the files are available, you will see the following output on your terminal else it will list missing dependencies name which is missing on your system.

So how to solve missing libraries? Copy the missing libraries name and search on the internet you will get the information about the libraries.

config.status: creating config.h
            .       .
            \`-"'"-'/
             } 6 6 {
            ==. Y ,==
              /^^^\  .
             /     \  )  Ncat: A modern interpretation of classic Netcat
            (  )-(  )/
            -""---""---   /
           /   Ncat    \_/
          (     ____
           \_.=|____E
Configuration complete.

          :================:
         /||# nmap -A _   ||
        / ||              ||
       |  ||              ||
        \ ||              ||
          ==================
   ........... /      \.............
   :\        ############            \
   : ---------------------------------
   : |  *   |__________|| ::::::::::  |
   \ |      |          ||   .......   |
     --------------------------------- 8

  NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY
Configured with: ndiff zenmap nping openssl zlib libssh2 lua ncat
Configured without: localdirs

Step 5. Install Nmap on Linux

This is the last command which you need to type and nmap will get installed.

$ make
$ sudo make install

Wait for few minutes till Nmap get Installed in your Linux System, and you will get the confirmation Nmap is “NMAP SUCCESSFULLY INSTALLED.”

NMAP SUCCESSFULLY INSTALLED

Check Nmap version

After installing from nmap from package manager or Official source.The command are same to check nmap version.

Type command in your terminal

nmap --version

Command Output

Nmap version 7.91 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.3 openssl-1.1.1f nmap-libssh2-1.9.0 libz-1.2.11 libpcre-8.39 libpcap-1.9.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

Please let me know which step method you followed to install nmap on your Linux system.If you are facing any issue while installing comment below.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments