Tuesday 4 January 2022

How to resolve -bash netstat command not found on CentOS 8



Netstat is a command-line utility and provide ability to check open ports whether it is UDP or TCP. Its needs to separate installation by default this package is not available in CentOS 8 minimal.
 
This article describes How to resolve -bash netstat command not found on CentOS 8 System. 
 
[root@linuxcnf ~]# netstat --version
-bash: netstat: command not found
[root@linuxcnf ~]#
 
As per the above output, the package is not installed on the system which provides netstat command. Follow the below steps to resolve:
 
Step 1. Installing package: Run the following command to install netstat related packages:
 
[root@linuxcnf ~]# dnf install net-tools -y
……………………..
Installed:
  net-tools-2.0-0.52.20160912git.el8.x86_64
 
Complete!
[root@linuxcnf ~]#
 
Step 2. Verification: Run the following command to validate/verify the installation.
 
[root@linuxcnf ~]# netstat --version
net-tools 2.10-alpha
Fred Baumgarten, Alan Cox, Bernd Eckenfels, Phil Blundell, Tuan Hoang, Brian Micek and others
+NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_MASQUERADE +I18N +SELINUX
AF: (inet) +UNIX +INET +INET6 +IPX +AX25 +NETROM +X25 +ATALK -ECONET +ROSE +BLUETOOTH
HW:  +ETHER +ARC +SLIP +PPP +TUNNEL -TR +AX25 +NETROM +X25 +FR +ROSE +ASH +SIT +FDDI +HIPPI +HDLC/LAPB +EUI64
[root@linuxcnf ~]#
 
Done!!! Now the command “netstat” is available on CentOS 8 system.

No comments:

Post a Comment