当前位置:   article > 正文

Linux解决 -bash: nc: command not found问题

Linux解决 -bash: nc: command not found问题

1 问题

  1. [root@cm ~]# nc -l 9000
  2. -bash: nc: command not found

  提示: 无法使用这个nc命令。因为没有配置这个命令。 

2 解决办法

输入命令: 

[root@hadoop1 ~]# yum install -y nc

运行结果:

  1. [root@cm ~]# yum install -y nc
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.163.com
  5. * extras: centos.ustc.edu.cn
  6. * updates: centos.ustc.edu.cn
  7. Resolving Dependencies
  8. --> Running transaction check
  9. ---> Package nmap-ncat.x86_64 2:6.40-16.el7 will be installed
  10. --> Processing Dependency: libpcap.so.1()(64bit) for package: 2:nmap-ncat-6.40-16.el7.x86_64
  11. --> Running transaction check
  12. ---> Package libpcap.x86_64 14:1.5.3-11.el7 will be installed
  13. --> Finished Dependency Resolution
  14. Dependencies Resolved
  15. ===================================================================================================================================
  16. Package Arch Version Repository Size
  17. ===================================================================================================================================
  18. Installing:
  19. nmap-ncat x86_64 2:6.40-16.el7 base 206 k
  20. Installing for dependencies:
  21. libpcap x86_64 14:1.5.3-11.el7 base 138 k
  22. Transaction Summary
  23. ===================================================================================================================================
  24. Install 1 Package (+1 Dependent package)
  25. Total download size: 344 k
  26. Installed size: 740 k
  27. Downloading packages:
  28. warning: /var/cache/yum/x86_64/7/base/packages/nmap-ncat-6.40-16.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
  29. Public key for nmap-ncat-6.40-16.el7.x86_64.rpm is not installed
  30. (1/2): nmap-ncat-6.40-16.el7.x86_64.rpm | 206 kB 00:00:00
  31. (2/2): libpcap-1.5.3-11.el7.x86_64.rpm | 138 kB 00:00:00
  32. -----------------------------------------------------------------------------------------------------------------------------------
  33. Total 517 kB/s | 344 kB 00:00:00
  34. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  35. Importing GPG key 0xF4A80EB5:
  36. Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
  37. Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
  38. Package : centos-release-7-4.1708.el7.centos.x86_64 (@anaconda)
  39. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  40. Running transaction check
  41. Running transaction test
  42. Transaction test succeeded
  43. Running transaction
  44. Installing : 14:libpcap-1.5.3-11.el7.x86_64 1/2
  45. Installing : 2:nmap-ncat-6.40-16.el7.x86_64 2/2
  46. Verifying : 14:libpcap-1.5.3-11.el7.x86_64 1/2
  47. Verifying : 2:nmap-ncat-6.40-16.el7.x86_64 2/2
  48. Installed:
  49. nmap-ncat.x86_64 2:6.40-16.el7
  50. Dependency Installed:
  51. libpcap.x86_64 14:1.5.3-11.el7
  52. Complete!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/197511
推荐阅读
相关标签
  

闽ICP备14008679号