Sunday 11 July 2021

How to resolve “-bash: nmap: command not found” on CentOS 8

By default, nmap command is not available in CentOS8 minimal installation and other Linux distributions. The nmap command line utility is used for port scanning and services which are running on local or remote machine in a network. 

This article describes How to resolve “-bash: nmap: command not found” on CentOS8.
[root@linuxcnf ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
[root@linuxcnf ~]#
[root@linuxcnf ~]# nmap
-bash: nmap: command not found
[root@linuxcnf ~]#

Step 1. Package Installation: Run the following command to install nmap package:
[root@linuxcnf ~]# dnf install nmap
Last metadata expiration check: 1:05:41 ago on Sun 11 Jul 2021 04:11:21 PM IST.
Dependencies resolved.
  nmap-2:7.70-5.el8.x86_64                                                         nmap-ncat-2:7.70-5.el8.x86_64
[root@linuxcnf ~]#
Step 2. Verify the installation: Run the following commands to verify the installation:
[root@linuxcnf ~]# which nmap
[root@linuxcnf ~]#
[root@linuxcnf ~]# nmap -version
Nmap version 7.70 ( )
Platform: x86_64-redhat-linux-gnu
Compiled with: liblua-5.3.3 openssl-1.1.1 libpcre-8.42 libpcap-1.9.0-PRE-GIT nmap-libdnet-1.12 ipv6
Compiled without: libssh2 libz
Available nsock engines: epoll poll select
[root@linuxcnf ~]#
Done!!! Now the nmap command is available in the CentOS8 system.

No comments:

Post a Comment