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

rpm  (-qa)| grep 软件名

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

假设在生产环境中,系统的关键文件/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 软件名

rpm -qf 的使用技巧,以及怎样查找软件包的更多相关文章

  1. dpkg -S {file} #ubuntu 14.04 rpm -qf {file} #centos 7

    Linux查找命令或组件对应安装包的方法原创FJEagle 最后发布于2017-12-15 19:10:06 阅读数 4603 收藏展开Linux查找命令或组件对应安装包的方法当新搭建服务器或者维护不 ...

  2. 拾遗:{rpm、yum及源码方式管理软件包}

    一.yum配置文件位置 /etc/yum.conf /etc/yum.repos.d/*.repo 二.yum常用命令 install pkgs reinstall pkgs update pkgs ...

  3. rpm --qf 命令

    1. 环境准备: sudo apt-get install rpm (Ubuntu系统) wget ftp://rpmfind.net/linux/fedora-secondary/developme ...

  4. vs中不得不会的一些小技巧(1)——细说查找

    最近在改公司里面古老的asp代码,不说文件有1w个,起码也有7,8千,而且文件里面include一个嵌套一个...当某天jira平台 上出现了需要你改的bug的时候,甚至都不知道这个错误在哪个页面,更 ...

  5. eclipse使用技巧---使用正则表达式查找替换

    1,Eclipse ctrl+f 打开查找框2,选中 Regular expressions (正则表达式) 去掉/* */(eclipse)        /\*(.|[\r\n])*?\*/去掉/ ...

  6. 数据算法 --hadoop/spark数据处理技巧 --(15.查找、统计和列出大图中的所有三角形 16.k-mer计数)

    十五.查找.统计和列出大图中的所有三角形 第一步骤的mr: 第二部mr: 找出三角形 第三部:去重 spark: 十六: k-mer计数 spark:

  7. POJ 2456 编程技巧之------二分查找思想的巧妙应用

    Aggressive cows Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18599   Accepted: 8841 ...

  8. centos保存rpm到本地以及使用yum完全卸载软件包

    目录 保存安装的rpm到本地 方法一: 方法二(推荐): yum卸载软件包包括依赖 保存安装的rpm到本地 方法一: [root@ServerA ~]# vim /etc/yum.conf [main ...

  9. ubuntu查找软件包

    sudo apt-cache search s_name

随机推荐

  1. 前端的标配:npm是什么及其安装(含cnpm)

    前端的标配:npm是什么及其安装 一:npm是什么及其来源 参考来源:npm是干什么的 总结:不需要去相关的网站下载依赖,用一个工具把这些依赖集中起来管理 NPM 的思路大概是这样的: 1)买个服务器 ...

  2. Linux下MySql数据库常用操作

    1.显示数据库 show databases; 2.选择数据库 use 数据库名; 3.显示数据库中的表 show tables; 4.显示数据表的结构 describe 表名; 5.显示表中记录 S ...

  3. Spring+Mybatis+SpringMVC后台与前台分页展示实例

    摘要:本文实现了一个后台由spring+Mybatis+SpringMVC组成,分页采用PageHelper,前台展示使用bootstrap-paginator来显示效果的分页实例.整个项目由mave ...

  4. [ES2018] Two ways to write for-await-of

    // Asynchronous iteration --> Symbol.asyncIterator async function main() { const syncIterable = [ ...

  5. C++ OTL MySQL(Windows/Linux) V8.1

    Windows每秒钟10000条以上插入:Linux每秒插入300条以上.Q269752451 输出截图: Linux输出: Windows输出: 有须要的联系 QQ 3508551694 water ...

  6. Crazyflie 2.0 System Architecture

    Crazyflie 2.0架构包含两个微控制器: A NRF51, Cortex-M0, 用于实现无线通信和电源管理: (1)按键开关逻辑(ON/OFF logic) (2)控制给其它系统供电(STM ...

  7. Double 与 Float 的值的比較结果

    首先看geeksforgeeks上的两个程序: 程序1: #include<stdio.h> int main() { float x = 0.1; if (x == 0.1) print ...

  8. LeetCode——Copy List with Random Pointer

    A linked list is given such that each node contains an additional random pointer which could point t ...

  9. jar 包的认识与处理、jar 文件 war 文件以及 ear 文件

    1. jar 包 将 jar 包解压,其实是该类(.java)编译好的(.class)文件. 包路径 package 多层嵌套的 packages META-INF 文件夹 2. 常用 jar 包及其 ...

  10. URAL 1297 后缀数组+线段树

    思路: 论文题--*n 倒过来接上 分奇偶讨论 求LCP 搞棵线段树即可 //By SiriusRen #include <cstdio> #include <cstring> ...