Linux Up Skill - Day 17
Moving on to lesson 17 of the Linux Up Skill Challenge. Today’s lesson is entitled “Build from the source.” This should be an interesting lesson. Let’s check it out! So we are going to install software directly from the source instead of from a repository package manager like apt. This can quickly get sticky with missing dependencies but as long as you take it slow and steady you can usually come out ahead.
So we have to start by installing a compiler for the source files we are going to download. sudo apt install build-essential. Now we are checking on the version of nmap installed.
david@linux-up-skill:/tmp# nmap -V Nmap version 7.80 ( https://nmap.org ) Platform: x86_64-pc-linux-gnu Compiled with: liblua-5.3.3 openssl-1.1.1d nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.9.1 nmap-libdnet-1.12 ipv6 Compiled without: Available nsock engines: epoll poll select david@linux-up-skill:/tmp# which nmap /usr/bin/nmap
The lesson has me cd
to get back to my home directory then run wget -v https://nmap.org/dist/nmap-7.92.tar.bz2
to download the source files. Now we can decompress and extract with tar -jxvf nmap-7-92.tar.bz2
. Then cd nmap-7-92
lets me see the source files and the lesson has me read through some of the commenting in the files. Now we can begin to install. This process starts with ./configure
which takes some time to go through all of its steps. I follow this with make
which also takes some time to complete the compile. I finish with sudo make install
to actually perform the installation on the system and produces an output of NMAP SUCCESSFULLY INSTALLED
. Fantastic!
Now the lesson explains the difference of utilities in /bin
, /usr/bin
, and /usr/local/bin
. Next the lesson wants me to locate where this utility was installed. First I run sudo updatedb
to update my index of files. Now I can perform my search:
david@linux-up-skill:~/nmap-7.92# locate bin/nmap /usr/bin/nmap /usr/local/bin/nmap david@linux-up-skill:~/nmap-7.92# /usr/bin/nmap -V Nmap version 7.80 ( https://nmap.org ) Platform: x86_64-pc-linux-gnu Compiled with: liblua-5.3.3 openssl-1.1.1d nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.9.1 nmap-libdnet-1.12 ipv6 Compiled without: Available nsock engines: epoll poll select david@linux-up-skill:~/nmap-7.92# /usr/local/bin/nmap -V Nmap version 7.92 ( https://nmap.org ) Platform: x86_64-unknown-linux-gnu Compiled with: nmap-liblua-5.3.5 nmap-libz-1.2.11 nmap-libpcre-7.6 nmap-libpcap-1.9.1 nmap-libdnet-1.12 ipv6 Compiled without: openssl libssh2 Available nsock engines: epoll poll select
So this new version of nmap
is installed at /usr/local/bin/nmap
while the original version is installed at /usr/bin/nmap
. This was good practice. I think the last time I did this was for running Quake 2 and Counter-Strike servers a very long time ago.