新随笔  :: 管理

查询Linux某命令依赖哪个包

Posted on 2020-07-15 13:11  SliverLee  阅读(1778)  评论(0编辑  收藏  举报

在Linux中,某些命令名称和rpm包的名称是不一样的,需要通过查询其依赖包进行安装。

CentOS:

比如ifconfig安装:
[root@192.168.138.150-mysql-master ~] # yum provides *bin/ifconfig Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: my.mirrors.thegigabit.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com net-tools-2.0-0.25.20131004git.el7.x86_64 : Basic networking tools Repo : base Matched from: Filename : /sbin/ifconfig net-tools-2.0-0.25.20131004git.el7.x86_64 : Basic networking tools Repo : @base Matched from: Filename : /sbin/ifconfig

==========================================
[root@192.168.138.150-mysql-master ~] # yum -y install net-tools

 

  注:其它版本的linux系统可能有所不同。

    Centos系统还可以使用这个命令  # yum whatprovides */ifconfig