User Tools

Site Tools


yum_rpm_handling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

yum_rpm_handling [2011/09/16 14:04]
root
yum_rpm_handling [2013/09/27 10:55] (current)
root
Line 1: Line 1:
 ====== RPM handling ====== ====== RPM handling ======
 +
 +===== List query tags =====
 +
 +  rpm --querytags
 +
 +===== List package that provide file =====
 +
 +  rpm -q --whatprovides <​filename>​
 +  Example:
 +  rpm -q --whatprovides /​usr/​bin/​lsscsi
 +  lsscsi-0.23-2.el6.x86_64
 +  ​
 +
 +===== List files provided by installed rpm package =====
 +
 +  rpm -ql *package*
 +  ​
 +
 +===== List files provided by rpm package placed in current folder =====
 +
 +  rpm -qlp *package*
 +
 +===== List scripts provided by installed rpm package =====
 +  ​
 +  rpm -q --scripts *package*
 +  ​
 +===== List scripts provided by rpm package placed in current folder =====
 +  ​
 +  rpm -qp --scripts *package*
  
 ===== List package vendors ===== ===== List package vendors =====
Line 14: Line 43:
   ​   ​
   rpm -qa --last   rpm -qa --last
 +  rpm -qa --queryformat '​%{installtime} (%{installtime:​date}) %{name}\n'​ | sort -n
   ​   ​
-===== Show all installed GPG keys =====+===== Show all installed ​public ​GPG keys =====
  
   rpm -q gpg-pubkey --qf '​%{name}-%{version}-%{release} --> %{summary}\n' ​   rpm -q gpg-pubkey --qf '​%{name}-%{version}-%{release} --> %{summary}\n' ​
   ​   ​
-===== Remove installed GPG key =====+===== Remove installed ​public ​GPG key =====
   ​   ​
   rpm -e --allmatches gpg-pubkey-<​pub signature>​   rpm -e --allmatches gpg-pubkey-<​pub signature>​
   ​   ​
 +===== List public GPG key included in signed RPM package =====
 +
 +  rpm -Kv <RPM package>
 +
 +  rpm -Kv zsh-4.3.10-4.1.el6.x86_64.rpm
 +  zsh-4.3.10-4.1.el6.x86_64.rpm:​
 +    Header V3 RSA/SHA256 Signature, key ID fd431d51: OK
 +    Header SHA1 digest: OK (65b8120096b3ffdec9f34767883a7e343442b388)
 +    V3 RSA/SHA256 Signature, key ID fd431d51: OK
 +    MD5 digest: OK (0fd7878f63df3b48b5d0099ea9c81717)
 +
 +If the RPM package is not signed the output will be missing the SHA/RSA signatures.
 +
 +  rpm -Kv TIVsm-API64.x86_64.rpm
 +    TIVsm-API64.x86_64.rpm:​
 +    Header SHA1 digest: OK (07dad9f7be72b5a322c355038589b75dbf5038b6)
 +    MD5 digest: OK (67ae54c20e4195c48bb3c7a90b7655db)
 +
 +The SHA1 & MD5 digest information is the cheksums.
 +
 +===== Sign RPM package ===== 
 +
 +  rpm --addsign <RPM package>
 +  ​
 +===== Show verbose information about RPM package =====
 +  ​
 +  rpm -qip <​package.rpm>​
 +
 +  rpm -qip zsh-4.3.10-4.1.el6.x86_64.rpm
 +  Name        : zsh                          Relocations:​ (not relocatable)
 +  Version ​    : 4.3.10 ​                           Vendor: Red Hat, Inc.
 +  Release ​    : 4.1.el6 ​                      Build Date: Tue 08 Dec 2009 09:35:26 PM CET
 +  Install Date: (not installed) ​              Build Host: ls20-bc2-13.build.redhat.com
 +  Group       : System Environment/​Shells ​    ​Source RPM: zsh-4.3.10-4.1.el6.src.rpm
 +  Size        : 5011302 ​                         License: BSD
 +  Signature ​  : RSA/8, Mon 16 Aug 2010 10:35:42 PM CEST, Key ID 199e2f91fd431d51
 +  Packager ​   : Red Hat, Inc. <​http://​bugzilla.redhat.com/​bugzilla>​
 +  URL         : http://​zsh.sunsite.dk/​
 +  Summary ​    : A powerful interactive shell
 +  Description :
 +  The zsh shell is a command interpreter usable as an interactive login
 +  shell and as a shell script command processor. ​ Zsh resembles the ksh
 +  shell (the Korn shell), but includes many enhancements. ​ Zsh supports
 +  command line editing, built-in spelling correction, programmable
 +  command completion, shell functions (with autoloading),​ a history
 +  mechanism, and more.
 +
 +===== Show verbose information about installed rpm package =====
 +
 +  rpm -qi *package*
 +
  ===== Extract files from RPM package ​ =====  ===== Extract files from RPM package ​ =====
  
Line 32: Line 113:
   ​   ​
 ====== Yum handling ====== ====== Yum handling ======
 +
 +===== Query Available Packages From Selected YUM Repository =====
 +
 +  yum --disablerepo="​*"​ --enablerepo="​google"​ list available
 +
 +===== List files in rpm package available from repository =====
 +
 +This applies to both installed packages and just available packages. Requires yum-utils.
 +
 +  repoquery -l *package*
 +  ​
 +===== List package denpendencies =====
   ​   ​
 +  yum deplist <​package>​
  
 ===== Only download packages ​ ===== ===== Only download packages ​ =====
yum_rpm_handling.txt ยท Last modified: 2013/09/27 10:55 by root