rpm -qf 的使用技巧,以及怎样查找软件包
首先查看安装的软件包,或者时候安装有某某软件包的命令
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 的使用技巧,以及怎样查找软件包的更多相关文章
- dpkg -S {file} #ubuntu 14.04 rpm -qf {file} #centos 7
Linux查找命令或组件对应安装包的方法原创FJEagle 最后发布于2017-12-15 19:10:06 阅读数 4603 收藏展开Linux查找命令或组件对应安装包的方法当新搭建服务器或者维护不 ...
- 拾遗:{rpm、yum及源码方式管理软件包}
一.yum配置文件位置 /etc/yum.conf /etc/yum.repos.d/*.repo 二.yum常用命令 install pkgs reinstall pkgs update pkgs ...
- rpm --qf 命令
1. 环境准备: sudo apt-get install rpm (Ubuntu系统) wget ftp://rpmfind.net/linux/fedora-secondary/developme ...
- vs中不得不会的一些小技巧(1)——细说查找
最近在改公司里面古老的asp代码,不说文件有1w个,起码也有7,8千,而且文件里面include一个嵌套一个...当某天jira平台 上出现了需要你改的bug的时候,甚至都不知道这个错误在哪个页面,更 ...
- eclipse使用技巧---使用正则表达式查找替换
1,Eclipse ctrl+f 打开查找框2,选中 Regular expressions (正则表达式) 去掉/* */(eclipse) /\*(.|[\r\n])*?\*/去掉/ ...
- 数据算法 --hadoop/spark数据处理技巧 --(15.查找、统计和列出大图中的所有三角形 16.k-mer计数)
十五.查找.统计和列出大图中的所有三角形 第一步骤的mr: 第二部mr: 找出三角形 第三部:去重 spark: 十六: k-mer计数 spark:
- POJ 2456 编程技巧之------二分查找思想的巧妙应用
Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18599 Accepted: 8841 ...
- centos保存rpm到本地以及使用yum完全卸载软件包
目录 保存安装的rpm到本地 方法一: 方法二(推荐): yum卸载软件包包括依赖 保存安装的rpm到本地 方法一: [root@ServerA ~]# vim /etc/yum.conf [main ...
- ubuntu查找软件包
sudo apt-cache search s_name
随机推荐
- springboot的几个缓存相关注解
@Cacheable:查询 几个属性: cacheNames/value:指定缓存组件的名字: key:缓存数据使用的key,可以用来指定.默认即使用方法参数的值 keyGenerator ...
- C# 实现窗口程序winform像QQ一样靠近桌面边缘自动隐藏窗口
实现原理: 实现这个功能的原理步骤如下: 1.判断窗体程序是否靠近桌面边缘: 2.获取桌面屏幕大小与窗体程序大小: 3.把窗体程序显示在桌面以外隐藏起来,预留部分窗体方便用户拉出程序: 4.判断鼠标是 ...
- jvm 虚拟机参数_栈内存分配
1.参数 -Xss 指定线程最大的栈空间,整个参数也直接决定了函数可调用的最大深度 2.测试代码 private static int count; public static void addCou ...
- DDL表结构修改
*1)创建表 create table 表名( 字段名 类型, .... ); //以现有表复制一个新表 create table j012 as se ...
- Mybatis解决了JDBC编程哪些问题
一:Mybatis简介 MyBatis是一个优秀的持久层框架,它对jdbc的操作数据库的过程进行封装,使开发者只需要关注 SQL 本身,而不需要花费精力去处理例如注册驱动.创建connection.创 ...
- 楼宇自控-BA系统流程总图
总结一下过程中的节点和技能,希望能对其他人有所帮助
- C#-MSMQ安装及配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- 洛谷 P3507 [POI2010]GRA-The Minima Game
P3507 [POI2010]GRA-The Minima Game 题目描述 Alice and Bob learned the minima game, which they like very ...
- uva_644暴力加字典树解法
暴力 #include<iostream> #include<string.h> #include<cstdio> using namespace std; int ...
- Linux下iscsi的使用
查看是否已安装了iscsi-initiator: [root@test\ ~]# rpm -qa |grep iscsi iscsi-initiator-utils-6.2.0.868-0.18.e ...