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

1 问题

复制代码
[root@cm ~]# nc -l 9000

-bash: nc: command not found

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

2 解决办法

输入命令:

复制代码
[root@hadoop1 ~]# yum install -y nc

运行结果:

复制代码
[root@cm ~]# yum install -y nc

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.163.com

* extras: centos.ustc.edu.cn

* updates: centos.ustc.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package nmap-ncat.x86_64 2:6.40-16.el7 will be installed

--> Processing Dependency: libpcap.so.1()(64bit) for package: 2:nmap-ncat-6.40-16.el7.x86_64

--> Running transaction check

---> Package libpcap.x86_64 14:1.5.3-11.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===================================================================================================================================

Package Arch Version Repository Size

===================================================================================================================================

Installing:

nmap-ncat x86_64 2:6.40-16.el7 base 206 k

Installing for dependencies:

libpcap x86_64 14:1.5.3-11.el7 base 138 k


Transaction Summary

===================================================================================================================================

Install 1 Package (+1 Dependent package)


Total download size: 344 k

Installed size: 740 k

Downloading packages:

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

Public key for nmap-ncat-6.40-16.el7.x86_64.rpm is not installed

(1/2): nmap-ncat-6.40-16.el7.x86_64.rpm | 206 kB 00:00:00

(2/2): libpcap-1.5.3-11.el7.x86_64.rpm | 138 kB 00:00:00

-----------------------------------------------------------------------------------------------------------------------------------

Total 517 kB/s | 344 kB 00:00:00

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Importing GPG key 0xF4A80EB5:

Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"

Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5

Package : centos-release-7-4.1708.el7.centos.x86_64 (@anaconda)

From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Installing : 14:libpcap-1.5.3-11.el7.x86_64 1/2

Installing : 2:nmap-ncat-6.40-16.el7.x86_64 2/2

Verifying : 14:libpcap-1.5.3-11.el7.x86_64 1/2

Verifying : 2:nmap-ncat-6.40-16.el7.x86_64 2/2


Installed:

nmap-ncat.x86_64 2:6.40-16.el7


Dependency Installed:

libpcap.x86_64 14:1.5.3-11.el7


Complete!
相关推荐
胡西风_foxww33 分钟前
Java的extends通配符
java·开发语言·通配符·extends
胡萝卜的兔1 小时前
golang -gorm 增删改查操作,事务操作
开发语言·后端·golang
屁股割了还要学1 小时前
快速过一遍Python基础语法
开发语言·python·学习·青少年编程
武当豆豆2 小时前
C++编程学习阶段性总结
开发语言·c++
学不动CV了3 小时前
C语言32个关键字
c语言·开发语言·arm开发·单片机·算法
你怎么知道我是队长3 小时前
python-enumrate函数
开发语言·chrome·python
小屁孩大帅-杨一凡4 小时前
如何解决ThreadLocal内存泄漏问题?
java·开发语言·jvm·算法
大熋4 小时前
Playwright Python 教程:网页自动化
开发语言·python·自动化
赟赟、嵌入式4 小时前
imx6ul Qt运行qml报错This plugin does not support createPlatformOpenGLContext!
开发语言·qt
cdg==吃蛋糕5 小时前
selenium 使用方法
开发语言·python