provide查找命令软件包

查询命令属于哪个软件包

yum search

查找netstat属于哪个软件包

[root@master ~]# yum search netstat
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
======================================================================= 匹配:netstat =======================================================================
dstat.noarch : Versatile resource statistics tool
net-snmp.x86_64 : A collection of SNMP protocol tools and libraries
net-tools.x86_64 : Basic networking tools

直接安装显示的软件包即可

[root@master ~]# yum install net-tools -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
centos                                                                                                                                | 3.6 kB  00:00:00     
k8s                                                                                                                                   | 3.0 kB  00:00:00     
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.25.20131004git.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=============================================================================================================================================================
 Package                             架构                             版本                                               源                             大小
=============================================================================================================================================================
正在安装:
 net-tools                           x86_64                           2.0-0.25.20131004git.el7                           k8s                           306 k

事务概要
=============================================================================================================================================================
安装  1 软件包

总下载量:306 k
安装大小:917 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                                1/1 
  验证中      : net-tools-2.0-0.25.20131004git.el7.x86_64                                                                                                1/1 

已安装:
  net-tools.x86_64 0:2.0-0.25.20131004git.el7                                                                                                                

完毕!

yum provides

[root@shell ~ 19]# yum provides locate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
centos/filelists_db                                      | 3.0 MB     00:00     
mlocate-0.26-6.el7.x86_64 : An utility for finding files by name
Repo        : centos
Matched from:
Filename    : /usr/bin/locate

安装软件包

通过上面查询到locate属于mlocate软件包,通过yum直接安装这个软件包就可以了

[root@shell ~ 20]# yum install -y mlocate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mlocate.x86_64 0:0.26-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch             Version              Repository        Size
================================================================================
Installing:
 mlocate           x86_64           0.26-6.el7           centos           113 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 113 k
Installed size: 378 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mlocate-0.26-6.el7.x86_64                                    1/1 
  Verifying  : mlocate-0.26-6.el7.x86_64                                    1/1 

Installed:
  mlocate.x86_64 0:0.26-6.el7                                                   

Complete!

检查软件包是否安装成功

显示软件包全名了以后代表安装成功

[root@shell ~ 29]# rpm -qa mlocate
mlocate-0.26-6.el7.x86_64

查找命令路径

前面是命令路径,后面是帮助手册(man)的路径

[root@shell ~ 34]# whereis locate
locate: /usr/bin/locate /usr/share/man/man1/locate.1.gz

用locate查找文件、目录的路径

写在另一个上面了
https://blog.csdn.net/qq_44792624/article/details/107798912

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值