博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
rpm -qf 的使用技巧,以及如何查找软件包
阅读量:5738 次
发布时间:2019-06-18

本文共 4956 字,大约阅读时间需要 16 分钟。

首先查看安装的软件包,或者时候安装有某某软件包的命令

rpm (-qa)| grep 软件名

[html] view plain copy

print?

root@mode oldboy]# rpm -qa| grep openssl  openssl-devel-0.9.8e-22.el5  openssl-0.9.8e-22.el5  openssl-0.9.8e-22.el5  openssl-devel-0.9.8e-22.el5  [root@mode oldboy]# yum search openssl  Loaded plugins: fastestmirror, security  Loading mirror speeds from cached hostfile  file:///mnt/cdrom/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/mnt/cdrom/repodata/repomd.xml'  Trying other mirror.  =============================== Matched: openssl ===============================  m2crypto.x86_64 : Support for using OpenSSL in python scripts  openssl.i686 : The OpenSSL toolkit  openssl.x86_64 : The OpenSSL toolkit  openssl-devel.i386 : Files for development of applications which will use                     : OpenSSL  openssl-devel.x86_64 : Files for development of applications which will use                       : OpenSSL  openssl-perl.x86_64 : Perl scripts provided with OpenSSL  openssl097a.i386 : The OpenSSL toolkit  openssl097a.x86_64 : The OpenSSL toolkit  perl-Crypt-SSLeay.x86_64 : Crypt::SSLeay - OpenSSL glue that provides LWP https                           : support  perl-Net-SSLeay.x86_64 : Perl extension for using OpenSSL  pyOpenSSL.x86_64 : Python wrapper module around the OpenSSL library  xmlsec1.i386 : Library providing support for "XML Signature" and "XML               : Encryption" standards  xmlsec1.x86_64 : Library providing support for "XML Signature" and "XML                 : Encryption" standards  xmlsec1-openssl.i386 : OpenSSL crypto plugin for XML Security Library  xmlsec1-openssl.x86_64 : OpenSSL crypto plugin for XML Security Library  xmlsec1-openssl-devel.i386 : OpenSSL crypto plugin for XML Security Library  xmlsec1-openssl-devel.x86_64 : OpenSSL crypto plugin for XML Security Librar

[html] view plain copy

print?

如果在生产环境中,系统的重要文件/etc/inittab被删除了(系统还没重启,崩溃前),不要急,下面告诉你该如何处理。  1、模拟误删除文件  [root@localhost ~]# rm -rf /etc/inittab  [root@localhost ~]# cat /etc/inittab  cat: /etc/inittab: No such file or directory  2、新建该文件,并查看对应包的相关信息  [root@localhost ~]# touch /etc/inittab  [root@localhost ~]# rpm -qf /etc/inittab  initscripts-8.45.19.EL-1  3、确定了包的相关信息,挂载安装光盘,进行查找  [root@localhost ~]# cd /mnt/yum/  [root@localhost yum]# ll  total 0  [root@localhost yum]# cd ~  [root@localhost ~]# mount /dev/cdrom /mnt/yum  mount: block device /dev/cdrom is write-protected, mounting read-only  [root@localhost ~]# cd /mnt/yum/Server/  [root@localhost Server]# cp initscripts-8.45.30-2.el5.i386.rpm /tmp  cp: overwrite `/tmp/initscripts-8.45.30-2.el5.i386.rpm'? y  [root@localhost Server]# cd /tmp  [root@localhost tmp]# ll  total 1680  drwx------ 2 root root    4096 Feb 17 13:45 bin  drwx------ 9 root root    4096 Feb 17 13:45 etc  drwx------ 3 root root    4096 Feb 17 13:53 gconfd-root  -r--r--r-- 1 root root 1651907 Feb 17 15:41 initscripts-8.45.30-2.el5.i386.rpm  drwx------ 2 root root    4096 Feb 17 13:53 keyring-06YG9F  drwx------ 2 root root    4096 Sep 26 08:44 keyring-elqVM1  drwx------ 2 root root    4096 Sep 26 08:08 keyring-jTNbTb  drwx------ 3 root root    4096 Feb 17 13:45 lib  srwxr-xr-x 1 root root       0 Feb 17 13:54 mapping-root  drwx------ 2 root root    4096 Feb 17 15:38 orbit-root  drwx------ 2 root root    4096 Feb 17 13:45 sbin  drwx------ 2 root root    4096 Feb 17 13:53 ssh-ROxTuK6949  drwx------ 4 root root    4096 Feb 17 13:45 usr  drwx------ 4 root root    4096 Feb 17 13:45 var  drwx------ 2 root root    4096 Feb 17 13:54 virtual-root.2eelUV  drwxrwxrwt 2 root root    4096 Feb  5 12:19 VMwareDnD  drwx------ 2 root root    4096 Feb 17 13:53 vmware-root  4、解压包的信息  [root@localhost tmp]# rpm2cpio initscripts-8.45.30-2.el5.i386.rpm |cpio -imd  10748 blocks  [root@localhost tmp]# ll  total 1680  drwx------ 2 root root    4096 Feb 17 13:45 bin  drwx------ 9 root root    4096 Feb 17 13:45 etc  drwx------ 3 root root    4096 Feb 17 13:53 gconfd-root  -r--r--r-- 1 root root 1651907 Feb 17 15:41 initscripts-8.45.30-2.el5.i386.rpm  drwx------ 2 root root    4096 Feb 17 13:53 keyring-06YG9F  drwx------ 2 root root    4096 Sep 26 08:44 keyring-elqVM1  drwx------ 2 root root    4096 Sep 26 08:08 keyring-jTNbTb  drwx------ 3 root root    4096 Feb 17 13:45 lib  srwxr-xr-x 1 root root       0 Feb 17 13:54 mapping-root  drwx------ 2 root root    4096 Feb 17 15:38 orbit-root  drwx------ 2 root root    4096 Feb 17 13:45 sbin  drwx------ 2 root root    4096 Feb 17 13:53 ssh-ROxTuK6949  drwx------ 4 root root    4096 Feb 17 13:45 usr  drwx------ 4 root root    4096 Feb 17 13:45 var  drwx------ 2 root root    4096 Feb 17 13:54 virtual-root.2eelUV  drwxrwxrwt 2 root root    4096 Feb  5 12:19 VMwareDnD  drwx------ 2 root root    4096 Feb 17 13:53 vmware-root  5、进行文件替换与简单修改  [root@localhost tmp]# cp ./etc/inittab /etc/  cp: overwrite `/etc/inittab'? y  [root@localhost tmp]# cat /etc/inittab  收工!!!!!!!

yum search 软件名

rpm -qf 软件名

转载于:https://blog.51cto.com/13059784/2062311

你可能感兴趣的文章
iOS开发-邮件发送
查看>>
/etc/resolv.conf文件详解
查看>>
【转】VC的MFC中重绘函数的使用总结(整理)
查看>>
JQuery日记_5.13 Sizzle选择器(六)选择器的效率
查看>>
oracle查看经常使用的系统信息
查看>>
Django_4_视图
查看>>
Linux的netstat命令使用
查看>>
lvm讲解,磁盘故障小案例
查看>>
大快网站:如何选择正确的hadoop版本
查看>>
经过这5大阶段,你离Java程序员就不远了!
查看>>
IntelliJ IDEA 连接数据库详细过程
查看>>
thymeleaf 学习笔记-基础篇
查看>>
PHP-X开发扩展
查看>>
android学习笔记——onSaveInstanceState的使用
查看>>
工作中如何做好技术积累
查看>>
怎么用sysLinux做U盘双PE+DOS??
查看>>
Spring Transactional
查看>>
shell脚本实例
查看>>
我的友情链接
查看>>
Windows Phone 7 隔离存储空间资源管理器
查看>>