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) <[email protected]>"

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!
相关推荐
Python测试之道3 分钟前
Deepseek API+Python 测试用例一键生成与导出 V1.0.6(加入分块策略,返回更完整可靠)
开发语言·python·测试用例
SRC_BLUE_177 分钟前
Python GUI 编程 | QObject 控件基类详解 — 定时器
开发语言·数据库·python
啊阿狸不会拉杆14 分钟前
第二十一章:Python-Plotly库实现数据动态可视化
开发语言·python·plotly
滴答滴答嗒嗒滴25 分钟前
Python小练习系列 Vol.12:学生信息排序(sorted + key函数)
开发语言·python
愚润求学1 小时前
【C++】vector常用方法总结
开发语言·c++·vector
天天进步20151 小时前
Python项目-基于Flask的个人博客系统设计与实现(1)
开发语言·python·flask
安然无虞1 小时前
31天Python入门——第20天:魔法方法详解
开发语言·后端·爬虫·python
QQ__17646198241 小时前
Matlab安装tdms插件
开发语言·matlab·tdms插件
画个逗号给明天"1 小时前
C#从入门到精通(5)
开发语言·笔记·c#
赤秀2 小时前
C++模板初阶
开发语言·c++