Short Overview of RPMs in LinuxSerge Burlyga, March 2006 Abstract: This introduction to RPMs covers different types of queries as well as tips on how to obtain information on RPMs and list their contents. I. The Simplest Query
The query options are accessed by using the rpm -q <packagename> [<packagename>...]
The $ rpm -q filesystem filesystem-2.2.1-3 II. Querying Package Files
To apply the query to a package file instead of a currently installed
package, use the $ rpm -qp sun-icu-2.1-6.i386.rpm sun-icu-2.1-6 You may list more than one package file, or use shell globbing. Note that this information was retrieved from the contents of the RPM file itself, not from the file name. Renaming the package file does not affect these values. For example: $ mv sun-icu-2.1-6.i386.rpm charmander.sdklfj $ rpm -qp charmander.sdklfj sun-icu-2.1-6
All query commands may be applied to a package file simply by adding the
III. Querying All Installed Packages
To apply the query to all installed package, use the $ rpm -qa | head -10 dietlibc-0.21-7 kon2-fonts-0.3.9b-18.1 man-pages-fr-0.9.7-7 kudzu-devel-1.1.21-1 basesystem-8.0-2 bogl-0.1.9-27 compat-slang-1.4.5-5 diffstat-1.31-2 elfutils-0.89-1 glib-1.2.10-11.1 [...and so forth]
All query commands may be applied to all installed packages simply by
adding the IV. Useful Queries
The full list of query options is described in the QUERY OPTIONS
section of the General Information
The $ rpm -qpi sun-icu-2.1-6.i386.rpm Name : sun-icu Relocations: (not relocateable) Version : 2.1 Vendor: Sun Microsystems, Inc. Release : 6 Build Date: Mon 23 Feb 2004 12:07:17 PM PST Install Date: (not installed) Build Host: zzz-build.Sun.COM Group : Operation System Environment Source RPM: sun-icu-2.1-6.src.rpm Size : 12387614 License: ICU License -ICU 1.8.1 and later and Sun Microsystems Binary Code License (BCL) Signature : (none) Packager : Sun Microsystems, Inc. URL : http://www.sun.com/ Summary : International Components for Unicode 2.1 with Sun enhancements Description : The sun-icu package contains ICU 2.1 version of internationalization libraries and header files for C and C++ programming languages with additional Sun-specific enhancements. Listing All Files Contained in the RPM
Use the $ rpm -qpl sun-icu-2.1-6.i386.rpm | head -10 /opt/sun/private/include/layout/ArabicLayoutEngine.h /opt/sun/private/include/layout/GXLayoutEngine.h /opt/sun/private/include/layout/IndicLayoutEngine.h /opt/sun/private/include/layout/LEFontInstance.h /opt/sun/private/include/layout/LEGlyphFilter.h /opt/sun/private/include/layout/LEScripts.h /opt/sun/private/include/layout/LESwaps.h /opt/sun/private/include/layout/LETypes.h /opt/sun/private/include/layout/LayoutEngine.h /opt/sun/private/include/layout/OpenTypeLayoutEngine.h [...and so forth] V. Querying Individual Package Fields
The
$ rpm -q --qf
'%{name}\t%{version}-%{release}\t%{buildhost}\t%{buildtime}\n' mozilla
mozilla-nss mozilla-nspr
mozilla 1.4-3.0.18 porky.devel.redhat.com 1064264992
mozilla-nss 1.4-3.0.18 porky.devel.redhat.com 1064264992
mozilla-nspr 1.4-3.0.18 porky.devel.redhat.com 1064264992
See the man page for additional options which allow you to control the format of the individual fields.
For a list of all fields you may query, run VI. Removing RPMsUse the following command to remove RPMs:
$ rpm -e {name}
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
|