First, if you currently have a past release of nmap installed you should uninstall it now by typing this at the terminal:
sudo apt-get remove nmap
Dependencies
If you have a standard Ubuntu install and have never installed a program from source (probably why you are here) you will need to install some packages first. The two packages I had to install on a fresh Ubuntu were g++ and libssl. g++ is a C compiler and what will allow you to compile the code from source and libssl is for some of nmap's new features to run without issues. Here is how to install these packages:
sudo apt-get install g++
sudo apt-get install libssl0.9.8
Compiling nmap
Obtain the nmap source from the insecure website and follow the instructions on the nmap download page:
wget http://nmap.org/dist/nmap-5.00.tar.bz2
bzip2 -cd nmap-5.00.tar.bz2 | tar xvf -
cd nmap-5.00
./configure
make
sudo make install
Verify
To verify you have the correct version installed:
nmap -v
ncat -v
Conclusion
And there you have it, you have compiled your first program in Ubuntu from source. The problem I have seen most people have other than using linux and never getting past the apt-get install stage is the need for the g++ package. This is most likely why you always get a C compiler error when trying to compile. I hope this has been useful.
Till next time,
Jorge Orchilles
Comments
One response to “Install nmap 5.0 in Ubuntu”
Post a Comment | Post Comments (Atom)
After doing this, how can I uninstall it if I don't want it anymore?
September 13, 2009 at 11:04 AMPost a Comment