RPM Package

1. RPM package是什么?

RedHat Package Manager 软件包管理工具

Linux是通过rpm来管理和实现软件的安装、查看、删除的



2. 常用命令组合:

-ivh:安装显示安装进度--install--verbose--hash
-Uvh:升级软件包--Update;
-qpl:列出RPM软件包内的文件信息[Query Package list];
-qpi:列出RPM软件包的描述信息[Query Package install package(s)];
-qf:查找指定文件属于哪个RPM软件包[Query File];
-Va:校验所有的RPM软件包,查找丢失的文件[View Lost];

-e:删除包

3. CentOS / RHEL : How to find RPM installation date and time

You can use the following command to display the install date and time of all the packages installed on your system:

rpm -qa --last

For example:

# rpm -qa --last | more
aide-0.14-11.el6.x86_64                       Tue 22 Aug 2017 12:57:07 AM IST
tzdata-java-2017b-1.el6.noarch                Tue 22 Aug 2017 12:27:22 AM IST
trace-cmd-2.2.4-4.el6.x86_64                  Tue 22 Aug 2017 12:27:22 AM IST
ql2500-firmware-7.03.00-1.el6_5.noarch        Tue 22 Aug 2017 12:27:22 AM IST
hal-info-20090716-5.el6.noarch                Tue 22 Aug 2017 12:27:22 AM IST
zip-3.0-1.el6_7.1.x86_64                      Tue 22 Aug 2017 12:27:21 AM IST
........

You can grep for a specific rpm name and find out the time of installation only for that particular package. For example to find the installation time of all packages with string kernel in them (Returns the install date and time for all packages with kernel in their name, such as the kernel, kernel-utils, etc.):

# rpm -qa --last | grep kernel
dracut-kernel-004-409.el6_8.2.noarch          Tue 22 Aug 2017 12:26:53 AM IST
libreport-plugin-kerneloops-2.0.9-33.el6.x86_64 Tue 22 Aug 2017 12:26:23 AM IST
abrt-addon-kerneloops-2.0.8-43.el6.x86_64     Tue 22 Aug 2017 12:26:23 AM IST
kernel-2.6.32-504.el6.x86_64                  Fri 15 Aug 2014 10:00:46 PM IST
kernel-firmware-2.6.32-504.el6.noarch         Fri 15 Aug 2014 10:00:42 PM IST
kernel-headers-2.6.32-504.el6.x86_64          Fri 15 Aug 2014 09:58:41 PM IST

For information about a specific package, specify the package_name in the command:

# rpm -q --last [package_name]

For example, you can use this command to look at the Firefox package installation time :

# rpm -qa --last firefox
firefox-52.2.0-1.el6_9.x86_64                 Tue 22 Aug 2017 12:27:05 AM IST

Formatting the output

We can also format the output of the “rpm -qa –last” command as per our needs. For example you can list the installation time for Firefox RPM

# rpm -qa --queryformat '(%{installtime:date}) %{name}\n' firefox
(Tue 22 Aug 2017 12:27:05 AM IST) firefox

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值