First, let’s see the output of rpm usage.
NOTE! ALL THESE RESULTS AND COMMANDS ARE WRITE BY MYSELF, NOT COPIED FROM.
[1].Query with rpm -q option
<1>Query the binary from which RPM
<2>Query the documentation
<3>Query the name of packages contain words(e.g. “yum”)
Note we must include the grep pipe instead of wildcard char, this will not work because of BASH itself.
<4>Query which package provides
<5>Query which package is required
<6>Query files installed by RPM
<7>Query the configuration files of a package
<8>Query the RPM information
<9>Query the install script(
not RPM spec)
Detailed information: as you can see, scriptlets prefixed with pre is
execed before the action, and actions with the post suffix is execed
after actions.
[root@lab ~]# rpm –helpThen man rpm and see following query options:
Usage: rpm [OPTION...]
–quiet
Query/Verify package selection options:
-a, –all query/verify all packages
-f, –file query/verify package(s) owning file
-g, –group query/verify package(s) in group
-p, –package query/verify a package file
-W, –ftswalk query/verify package(s) from TOP file tree
walk
–pkgid query/verify package(s) with package
identifier
–hdrid query/verify package(s) with header
identifier
–fileid query/verify package(s) with file identifier
–specfile query a spec file
–triggeredby query the package(s) triggered by the
package
–whatrequires query/verify the package(s) which require a
dependency
–whatprovides query/verify the package(s) which provide a
dependency
–nomanifest do not process non-package files as
manifests
query-optionsAnd these are package query option of man:
[--changelog] [-c,--configfiles] [-d,--docfiles] [--dump]
[--filesbypkg] [-i,--info] [--last] [-l,--list]
[--provides] [--qf,--queryformat QUERYFMT]
[-R,--requires] [--scripts] [-s,--state]
[--triggers,--triggerscripts]
PACKAGE QUERY OPTIONS:And let’s try!
–changelog
Display change information for the package.
-c, –configfiles
List only configuration files (implies -l).
-d, –docfiles
List only documentation files (implies -l).
–dump Dump file information as follows (implies -l):
path size mtime digest mode owner group isconfig isdoc rdev symlin
k
–filesbypkg
List all the files in each selected package.
-i, –info
Display package information, including name, version, and
description. This uses the –queryformat if one was specified.
–last Orders the package listing by install time such that the latest
packages are at the top.
-l, –list
List files in package.
–provides
List capabilities this package provides.
-R, –requires
List capabilities on which this package depends.
–scripts
List the package specific scriptlet(s) that are used as part of
the installation and uninstallation processes.
-s, –state
Display the states of files in the package (implies -l). The
state of each file is one of normal, not installed, or replaced.
–triggers, –triggerscripts
Display the trigger scripts, if any, which are contained in the
package.
NOTE! ALL THESE RESULTS AND COMMANDS ARE WRITE BY MYSELF, NOT COPIED FROM.
[1].Query with rpm -q option
<1>Query the binary from which RPM
<4>Query which package provides
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
[root@lab ~]# rpm -qi yum
Name : yum Relocations: (not relocatable)
Version : 3.2.29 Vendor: CentOS
Release : 40.el6.centos Build Date: Fri Feb 22 20:26:41 2013
Install Date: Sat Mar 9 09:45:06 2013 Build Host: c6b8.bsys.dev.centos.org
Group : System Environment/Base Source RPM: yum-3.2.29-40.el6.centos.src.rpm
Size : 4735341 License: GPLv2+
Signature : RSA/SHA1, Sun Feb 24 02:50:22 2013, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
URL : http://yum.baseurl.org/
Summary : RPM package installer/updater/manager
Description :
Yum is a utility that can check for and automatically download and
install updated RPM packages. Dependencies are obtained and downloaded
automatically, prompting the user for permission as necessary.
|