Install nmap 6 on Debian or Ubuntu Linux

By | 2012/05/22

nmap 6 is out! It will be a couple of centuries before this is available in Debian, so I’ll show you how to easily create a .deb package right now. The following steps will provide a .deb package which is easy to cleanly uninstall at anytime as needed.

Updated 19 June 2012!

1. First install some needed packages:

$ sudo apt-get install build-essential libssl-dev libpathfinder-openssl-1 liblinear-dev libpcap0.8-dev libpcre3-dev checkinstall

2. Next, grab the latest nmap tarball from

$ wget

3. Extract:

$ tar xvf nmap-6.01.tar.bz2

4. Change to the nmap directory we extracted:

$ cd nmap-6.01/

5. Configure:

$ ./configure


$ make


$ sudo checkinstall

(When prompted, default values here are ok if the deb is only for your own use.)

$ sudo checkinstall
[sudo] password for stmiller: 

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.

The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.
>> nmap

**** Debian package creation selected ***

This package will be built according to these values: 

0 -  Maintainer: [ root@brahms ]
1 -  Summary: [ nmap ]
2 -  Name:    [ nmap ]
3 -  Version: [ 6.01 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ nmap-6.01 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ nmap ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...

========================= Installation results ===========================
/usr/bin/install -c -d /usr/local/bin /usr/local/share/man/man1 /usr/local/share/nmap
/usr/bin/install -c -c -m 755 nmap /usr/local/bin/nmap
/usr/bin/strip -x /usr/local/bin/nmap
/usr/bin/install -c -c -m 644 docs/nmap.1 /usr/local/share/man/man1/
if [ "yes" = "yes" ]; then \
	  for ll in de es fr hr hu it jp pl pt_BR pt_PT ro ru sk zh; do \
	    /usr/bin/install -c -d /usr/local/share/man/$ll/man1; \
	    /usr/bin/install -c -c -m 644 docs/man-xlate/nmap-$ll.1 /usr/local/share/man/$ll/man1/nmap.1; \
	  done; \
/usr/bin/install -c -c -m 644 docs/nmap.xsl /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 docs/nmap.dtd /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-services /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-payloads /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-rpc /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-os-db /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-service-probes /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-protocols /usr/local/share/nmap/
/usr/bin/install -c -c -m 644 nmap-mac-prefixes /usr/local/share/nmap/
/usr/bin/install -c -d /usr/local/bin /usr/local/share/man/man1
cd zenmap && /usr/bin/python --quiet install --prefix "/usr/local" --force 
/usr/bin/install -c -c -m 644 docs/zenmap.1 /usr/local/share/man/man1/
if [ ! -f /usr/local/bin/nmapfe -o -L /usr/local/bin/nmapfe ]; then \
		ln -sf zenmap /usr/local/bin/nmapfe; \
ln -sf zenmap /usr/local/bin/xnmap
make[1]: Entering directory `/home/stmiller/Downloads/build/nmap-6.00/ncat'
Installing Ncat
../shtool mkdir -f -p -m 755 /usr/local/bin /usr/local/share/man/man1
/usr/bin/install -c -c -m 755 ncat /usr/local/bin/ncat
/usr/bin/strip -x /usr/local/bin/ncat
if [ -n "certs/ca-bundle.crt" ]; then \
		../shtool mkdir -f -p -m 755 /usr/local/share/ncat; \
		/usr/bin/install -c -c -m 644 certs/ca-bundle.crt /usr/local/share/ncat/; \
/usr/bin/install -c -c -m 644 docs/ncat.1 /usr/local/share/man/man1/ncat.1
make[1]: Leaving directory `/home/stmiller/Downloads/build/nmap-6.00/ncat'
cd ndiff && /usr/bin/python install --prefix "/usr/local" 
running install
running build
running build_scripts
running install_scripts
copying build/scripts-2.7/ndiff -> /usr/local/bin
changing mode of /usr/local/bin/ndiff to 755
running install_data
copying docs/ndiff.1 -> /usr/local/share/man/man1
running install_egg_info
make[1]: Entering directory `/home/stmiller/Downloads/build/nmap-6.00/nping'
/usr/bin/install -c -d /usr/local/bin /usr/local/share/man/man1
/usr/bin/install -c -c -m 755 nping /usr/local/bin/nping
/usr/bin/strip -x /usr/local/bin/nping
/usr/bin/install -c -c -m 644 docs/nping.1 /usr/local/share/man/man1/
make[1]: Leaving directory `/home/stmiller/Downloads/build/nmap-6.00/nping'

======================== Installation successful ==========================

Copying documentation directory...

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Writing backup package...OK

Deleting temp dir...OK


 Done. The new package has been installed and saved to


 You can remove it from your system anytime using: 

      dpkg -r nmap



$ nmap -V

Nmap version 6.01 ( )
Platform: x86_64-unknown-linux-gnu
Compiled with: nmap-liblua-5.1.3 openssl-1.0.0h nmap-libpcre-8.12 nmap-libpcap-1.2.1 nmap-libdnet-1.12 ipv6
Compiled without: 

Hack on,

17 thoughts on “Install nmap 6 on Debian or Ubuntu Linux

  1. Thiago Vinícius V. Oliveira

    Man… it worked so nicely for me! Thanks.
    That are great instructions for the ones that love the bleeding edge software, specially for the security analysts like me!

  2. Adam Ziaja

    “$ /.configure –without-liblua”


    “$ ./configure –without-liblua”

  3. 4am

    I get all kinds of directory creation and permission errors – how do i get checkinstall to use different directories or create missing ones?

  4. Robbo

    I had to install libpathfinder-openssl-1 to have nmap compile with openssl support.

  5. Armando Ruddiger McGillacuddy

    Thanks. I haven’t compiled anything in ages. And yes, there is a type in the ./configure line. Thanks again!

    1. scott Post author

      Whoops thank you all, typo fixed. 🙂

  6. scott Post author

    Updated for nmap 6.01 and also removed indication to compile without liblua. nmap scripts requite lua! 6.01 appears to compile fine now with liblua. Thanks,

  7. Joakim

    First: thanks for these clear instructions!

    FWIW, after having run ‘checkinstall’ (without errors) I had to close down the ‘root terminal’ (I’m using Debian 6), and restart it before nmap was recognized. I am a n00b, so this may be par for the course, but in case someone else is struggling with the same issue…

  8. Scott Miller Post author

    If you see errors creating translation directories (like /usr/bin/install: cannot create directory) put


    in /etc/checkinstallrc


Leave a Reply

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.