在CentOS 7和RHEL 7上找不到netstat命令(Red Hat Enterprise Linux 7)

时间:2019-08-20 17:58:27  来源:igfitidea点击:

在RHEL7和CentOS 7中, 报错:
netstat command not found

netstat命令是由nettools包提供的

yum install net-tools

可以使用yum provides查看软件包提供了哪些文件。

[root@localhost ~]# yum provides */netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * extras: centos.aol.in
 * updates: centos.aol.in
ctdb-tests-2.5.1-2.el7.x86_64 : CTDB clustered database test suite
Repo        : base
Matched from:
Filename    : /usr/share/ctdb-tests/eventscripts/stubs/netstat



net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /bin/netstat



[root@localhost ~]# 
[root@localhost ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * extras: centos.aol.in
 * updates: centos.aol.in
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================
 Package                         Arch                         Version                                           Repository                  Size
=================================================================================================================================================
Installing:
 net-tools                       x86_64                       2.0-0.17.20131004git.el7                          base                       304 k

Transaction Summary
=================================================================================================================================================
Install  1 Package

Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm                                                                             | 304 kB  00:00:11     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                     1/1 
  Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64                                                                                     1/1 

Installed:
  net-tools.x86_64 0:2.0-0.17.20131004git.el7                                                                                                    

Complete!
[root@localhost ~]#