CentOS的yum如何找到需要命令的安装包

2021-08-08 928点热度 0人点赞 0条评论

CentOS下如果运行某个命令,显示找不到命令(command not found),这个时候,可以使用yum安装,但是我们怎么知道要安装什么包呢?或者大概知道关键词,需要知道安装包的名字。

我们可以使用yum provides来查找,以查找htpasswd为例:

[root@ecs-587c opt]# yum provides htpasswd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
httpd-tools-2.4.6-95.el7.centos.x86_64 : Tools for use with the Apache HTTP Server
Repo        : base
Matched from:
Filename    : /usr/bin/htpasswd



httpd-tools-2.4.6-97.el7.centos.x86_64 : Tools for use with the Apache HTTP Server
Repo        : updates
Matched from:
Filename    : /usr/bin/htpasswd

[root@ecs-587c opt]# yum install httpd-tools

如上,使用yum provides htpasswd 找到在httpd-tools包里有,所以再使用yum install httpd-tools安装就可以了

admin

这个人很懒,什么都没留下

文章评论

您需要 登录 之后才可以评论