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!
相关推荐
CodeSheep程序羊8 分钟前
拼多多春节加班工资曝光,没几个敢给这个数的。
java·c语言·开发语言·c++·python·程序人生·职场和发展
独好紫罗兰9 分钟前
对python的再认识-基于数据结构进行-a002-列表-列表推导式
开发语言·数据结构·python
I'mChloe17 分钟前
PTO-ISA 深度解析:PyPTO 范式生成的底层指令集与 NPU 算子执行的硬件映射
c语言·开发语言
编程小白202628 分钟前
从 C++ 基础到效率翻倍:Qt 开发环境搭建与Windows 神级快捷键指南
开发语言·c++·windows·qt·学习
像风一样的男人@1 小时前
python --读取psd文件
开发语言·python·深度学习
输出输入1 小时前
前端核心技术
开发语言·前端
加油,小猿猿1 小时前
Java开发日志-双数据库事务问题
java·开发语言·数据库
薛定谔的猫喵喵1 小时前
天然气压力能利用系统综合性评价平台:基于Python和PyQt5的AHP与模糊综合评价集成应用
开发语言·python·qt
独好紫罗兰1 小时前
对python的再认识-基于数据结构进行-a004-列表-实用事务
开发语言·数据结构·python
gjxDaniel1 小时前
Objective-C编程语言入门与常见问题
开发语言·objective-c