有关rpm包的查询命令

219 篇文章 2 订阅

查询某rpm的archtecture:

$ rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n" | grep libaio
libaio-0.3.103.3 (i386)
libaio-0.3.103.3 (x86_64)
libaio-devel-0.3.103.3 (x86_64)

查询某rpm包的提供商:

[root@rhel8server1 ~]# /bin/rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH} %{VENDOR}\n' |  grep glibc
glibc-2.28-42.el8.x86_64 Red Hat, Inc.
glibc-headers-2.28-42.el8.x86_64 Red Hat, Inc.
glibc-common-2.28-42.el8.x86_64 Red Hat, Inc.
glibc-all-langpacks-2.28-42.el8.x86_64 Red Hat, Inc.
glibc-devel-2.28-42.el8.x86_64 Red Hat, Inc.
glibc-langpack-en-2.28-42.el8.x86_64 Red Hat, Inc.
[root@rhel8server1 ~]# 

查询Vendor不是Oracle的rpm包:

rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} %{VENDOR}\n" | awk '{if($2!="Oracle") print$0;}'

根据某rpm包的包名(带全部路径)查询该包的详细信息:

[root@rhel8server1 Packages]# pwd
/mnt/cdrom/BaseOS/Packages
[root@rhel8server1 Packages]# rpm -qpi  /mnt/cdrom/BaseOS/Packages/glibc-2.28-42.el8.x86_64.rpm
Name        : glibc
Version     : 2.28
Release     : 42.el8
Architecture: x86_64
Install Date: (not installed)
Group       : Unspecified
Size        : 16642240
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL
Signature   : RSA/SHA256, Fri 14 Dec 2018 02:00:54 PM EST, Key ID 199e2f91fd431d51
Source RPM  : glibc-2.28-42.el8.src.rpm
Build Date  : Fri 14 Dec 2018 08:15:37 AM EST
Build Host  : x86-vm-01.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://www.gnu.org/software/glibc/
Summary     : The GNU libc libraries
Description :
The glibc package contains standard libraries which are used by
multiple programs on the system. In order to save disk space and
memory, as well as to make upgrading easier, common system code is
kept in one place and shared between programs. This particular package
contains the most important sets of shared libraries: the standard C
library and the standard math library. Without these two libraries, a
Linux system will not function.
[root@rhel8server1 Packages]# rpm -qa | grep glibc
glibc-2.28-42.el8.x86_64
glibc-headers-2.28-42.el8.x86_64
glibc-common-2.28-42.el8.x86_64
glibc-all-langpacks-2.28-42.el8.x86_64
glibc-devel-2.28-42.el8.x86_64
glibc-langpack-en-2.28-42.el8.x86_64
[root@rhel8server1 Packages]# 


根据已经安装的某rpm包的包名查询该包的详细信息:

[root@rhel8server1 Packages]# rpm -qi  glibc-2.28-42.el8.x86_64
Name        : glibc
Version     : 2.28
Release     : 42.el8
Architecture: x86_64
Install Date: Sun 19 May 2019 09:38:10 AM EDT
Group       : Unspecified
Size        : 16642240
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL
Signature   : RSA/SHA256, Fri 14 Dec 2018 02:00:54 PM EST, Key ID 199e2f91fd431d51
Source RPM  : glibc-2.28-42.el8.src.rpm
Build Date  : Fri 14 Dec 2018 08:15:37 AM EST
Build Host  : x86-vm-01.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor      : Red Hat, Inc.
URL         : http://www.gnu.org/software/glibc/
Summary     : The GNU libc libraries
Description :
The glibc package contains standard libraries which are used by
multiple programs on the system. In order to save disk space and
memory, as well as to make upgrading easier, common system code is
kept in one place and shared between programs. This particular package
contains the most important sets of shared libraries: the standard C
library and the standard math library. Without these two libraries, a
Linux system will not function.
[root@rhel8server1 Packages]# 

按照安装时间降序排列rpm包:

rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n'| sort -k1 -r|less

参考自:

How to check the vendor of installed RPM packages (文档 ID 2461863.1)
How To Determine Architecture From Installed RPM or OS (文档 ID 435531.1)
How to list the latest installed RPM package name (文档 ID 1553104.1)
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值