LINUX下借助YUM和RPM教你正确寻找并安装软件的姿式

   常常操做LINUX系统的人会发现,当咱们登陆一个并非由本身亲手部署的系统的时候,常常会发现习惯性的敲入一些命令的时候发现以下状况:(我用常常使用rz和sz工具举例)git

[root@splunk-centos ~]# rz
-bash: rz: command not found

   根据提示为命令没找到,通常人的作法以下:
centos

   百度“rz: command not found” 而后根据搜索页面打开网页,告诉你须要安装lrzsz包,而后执行yum install lrzszbash

   这个问题咱们能不能不用百度解决?ide

  答案是固然能够!工具

     

     这里有两个前提:centos7

         一、能够经过YUM访问软件仓库spa

         二、当前的YUM源仓库确实有这个数据包ip

还好我举例的rz&&sz 在大部分发行版官方源中有。怎么知道rz&&sz是在lrzsz包下的?部署

 

 [root@localhost data]# yum search rz
   Loaded plugins: fastestmirror
   Loading mirror speeds from cached hostfile
================================== N/S matched: rz ======================================
lrzsz.x86_64 : The lrz and lsz modem communications programs
Name and summary matches only, use "search all" for everything.

  

  看上到上面的lrzsz.x86_64了吗?说明rz命令在lrzsz包中,支持64位系统it

  而后yum install lrzsz -y 安装便可

  

  如今说第二个问题,若是我知道了某个软件包,想知道这个包都有那些工具(命令)怎么办?

  好比,centos7 默认最小化安装没有ifconfig,用刚才的方法你就能找到了,并yum 安装。

  既然是一个包,那么还包含了其它命名了没?

  利用rpm -qa 包名便可,如


[root@localhost ~]# rpm -ql net-tools
/bin/netstat
/sbin/arp
/sbin/ether-wake
/sbin/ifconfig
/sbin/ipmaddr
/sbin/iptunnel
/sbin/mii-diag
/sbin/mii-tool
/sbin/nameif
/sbin/plipconfig
/sbin/route
/sbin/slattach

我只截了命令,man帮助文件等省略。经过能够查看包的完整命令

[root@localhost ~]# rpm -qa |grep net-tools

net-tools-2.0-0.17.20131004git.el7.x86_64

哇,原来还安装了这么多命令呀,这个装一个rpm咱们就知道到底安装了什么,都在哪


  固然上面的两个前提若是不经过也不行,好比htop默认没在centos源中,你YUM 搜索就找不到

[root@localhost ~]# yum search all htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Warning: No matches found for: htop
No matches found

那就只能去安装第三方源了

相关文章
相关标签/搜索