summaryrefslogtreecommitdiff
path: root/rpm.8
blob: b33156c6cea1b599c0a3d604f587a7d5e8712acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
.\" rpm - Red Hat Package Manager
.TH rpm 8 "29 March 1996" "Red Hat Software" "Red Hat Linux"
.SH NAME
rpm \- Red Hat Package Manager
.SH SYNOPSIS
\fBrpm\fP [options] 
.SH DESCRIPTION
\fBrpm\fP is a powerful \fIpackage manager\fP, which can be used to
build, install, query, verify, update, and uninstall individual
software packages.  A \fIpackage\fP consists of an archive of files,
and package information, including name, version, and description.

There are five basic modes of operation, and each takes a different
set of options.  They are \fIbuild\fP, \fIinstall\fP, \fIquery\fP,
\fIverify\fP, \FIsignature check\fP, and \fIuninstall\fP.

.I "\fBrpm \-i [install\-options] <package_file>+\fP"
.br
.I "\fBrpm \-q [query\-options]\fP"
.br
.I "\fBrpm \-V|\-y|\-\-verify [verify\-options]\fP"
.br
.I "\fBrpm \-\-checksig <package_file>+\fP"
.br
.I "\fBrpm \-e <package_name>+\fP"
.br
.I "\fBrpm \-b\fIO\fB [build\-options] <package_spec>+\fP"

.SH INSTALL OPTIONS
.IP "\fB\-\-force\fP"
Same as using both \-\-replacepkgs, \-\-replacefiles, and 
\-\-oldpackage.
.IP "\fB\-h, \-\-hash\fP"
Print 50 hash marks as the package archive is unpacked.  Use
with \fB\-v\fP for a nice display.
.IP "\fB\-\-oldpackage\fP"
Allow an upgrade to replace a newer package with an older one.
.IP "\fB\-\-percent\fP"
Print percentages as files are unpacked from the package archive. This
is intended to make RPM easy to run from other tools.
.IP "\fB\-\-replacefiles\fP"
Install the packages even if they replace files from other, already
installed, packages.
.IP "\fB\-\-replacepkgs\fP"
Install the packages even if some of them are already installed on this
system.
.IP "\fB\-\-root \fI<dir>\fP"
Do the installation on the system rooted at \fI<dir>\fP.  Note that
this means the database will be updated under \fI<dir>\fP and any
\fIpre\fP or \fIpost\fP scripts are run after a chroot() to \fI<dir>\fP.
.IP "\fB\-\-noscripts\fP"
Don't execute the preinstall or postinstall scripts.
.IP "\fB\-\-excludedocs\fP"
Don't install any files which are marked as documentation (which includes
man pages and texinfo documents).
.IP "\fB\-\-includedocs\fP"
Install documentation files. This is only needed if \fIexcludedocs: 1\fP
is specified in an rpmrc file.
.IP "\fB\-\-test\fP"
Do not install the package, simply check for and report potential
conflicts.
.IP "\fB\-U, \-\-upgrade\fP"
Upgrade the package currently installed to the version in the new RPM.
This is the same as install, except all other version of the package
are removed from the system.

.SH UNINSTALL OPTIONS
.IP "\fB\-\-noscripts\fP"
Don't execute the preuninstall or postuninstall scripts.
.IP "\fB\-\-test\fP"
Don't really uninstall anything, just go through the motions. This is
designed primarily for testing and should normally be used with the
\fB\-vv\fP option.

.SH BUILD OPTIONS
The general form of a rpm build command is
.PP
    \fBrpm \-b\fIO\fP [build\-options] <package_spec>+\fP
.PP
where \fB\-bO\fP specifies the stages of building and
packaging to be done and is one of:

.IP "\fB\-bp\fP"
Executes the "%prep" stage from the spec file.  Normally this
involves unpacking the sources and applying any patches.
.IP "\fB\-bl\fP"
Do a "list check".  The "%files" section from the spec file
is macro expanded, and checks are made to insure the files
exist.
.IP "\fB\-bc\fP"
Do the "%build" stage from the spec file (after doing the prep stage).
This generally involves the equivalent of a "make".
.IP "\fB\-bi\fP"
Do the "%install" stage from the spec file (after doing the prep
and build stages).  This generally involves the equivalent of a
"make install".
.IP "\fB\-bb\fP"
Build a binary package (after doing the prep, build, and install stages).
.IP "\fB\-ba\fP"
Build binary and source packages (after doing the prep, build, and 
install stages).
.PP
The following options may also be used:
.IP "\fB\-\-short\-circuit\fP"
Skip straight to specified stage (ie, skip all stages leading up
to the specified stage).  Only valid for \fB\-bc\fP and \fB\-bi\fP.
.IP "\fB\-\-clean\fP"
Remove the build tree after the packages are made.
.IP "\fB\-\-test\fP"
Do not execute any build stages.  Implies \fB\-\-keep\-temps\fP.
Useful for testing out spec files.
.IP "\fB\-\-sign\fP"
Embed a PGP signature in the package.  This signature can be used
to verify the integrity and the origin of the package.  See the
section on PGP SIGNATURES for /etc/rpmrc details.

.SH QUERY OPTIONS

You may specify the format that the header portion should be printed 
in. To do this, you use the "\fB\--queryformat\fP" option, followed by 
the format string.

Query formats are modifed versions of the standard \fBprintf(3)\fP
formatting. The format is made up of static strings (which may include
standard C character escapes for newlines, tabs, and other special
characters) and the \fBprintf(3)\fP type formatters. As \fBrpm\fP
already knows the type to print, the type specifier must be
omitted however, and replaced by the name of the header tag to
be printed, which is enclosed by \fB{}\fP characters. The 
\fBRPMTAG_\fP portion of the tag name may be omitted, and the
tag name may be preceded by a \fB-\fP to format the tag as
a date if possible.

For example, to print only the names of the packages queried, you
could use \fB%{NAME}\fP as the format string. To print the packages
name and distribution information in two columns, you could use
\fB%-30{NAME}%{DISTRIBUTION}\fP.

\fBrpm\fP will print a list of all of the tags it knows about when
it is invoked with the \fB--querytags\fP argument and nothing else.

There are two subsets of options for querying: package selection, and
information selection.

Package selection options:
.br
.IP "\fB\fI<package_name>\fP"
Query pacakge named \fB\fI<package_name>\fP.
.IP "\fB\-a\fP"
Query all packages
.IP "\fB\-f \fI<file>\fP"
Query package owning \fI<file>\fP.
.IP "\fB\-F\fP"
Like \fB\-f\fP but read file names from stdin.
.IP "\fB\-p \fI<package_file>\fP"
Query an (uninstalled) package \fI<package_file>\fP.
.IP "\fB\-P\fP"
Like \fB\-p\fP but read package file names from stdin.
.br
Information selection options:
.br
.IP "\fB\-i\fP"
Display package information, including name, version, and description.
.IP "\fB\-l\fP"
List files in package.
.IP "\fB\-s\fP"
Display \fIstates\fP of file in package (implies \fB\-l\fP).  
The state of each package is
either \fInormal\fP, \fInot installed\fP, or \fIreplaced\fP.
.IP "\fB\-d\fP"
List only documentation files (implies \fB\-l\fP).  
.IP "\fB\-c\fP"
List only configuration files (implies \fB\-l\fP).  
.IP "\fB\-\-scripts\fP"
List the package specific shell scripts that are used as part of the 
installation and uninstallation processes, if there are any.

.SH VERIFY OPTIONS
Verifying a package compares information about the installed
files in the package with information about the files taken from the
original package and stored in the rpm database.  Among other things,
verifying compares the size, MD5 sum, permissions, type, owner and group
of each file.  Any discrepencies are displayed.  The package specification
options are the same as for package querying.

The format of the output is a string of 8 characters, an optional "\fBc\fP"
denoting a configuration file, and then the file name.  Each of the 8
characters denotes the result of a comparison of one aspect of the file
to that aspect as recorded in the RPM database.  A single "\fB.\fP" (period)
means the test passed.  The following characters denote failure of certain
tests:

.IP "\fB5\fP"
MD5 sum
.IP "\fBS\fP"
File size
.IP "\fBL\fP"
Symlink
.IP "\fBT\fP"
Mtime
.IP "\fBD\fP"
Device
.IP "\fBU\fP"
User
.IP "\fBG\fP"
Group
.IP "\fBM\fP"
Mode (includes permissions and file type)

.SH SIGNATURE CHECKING
This checks the PGP signature built into a package to ensure the integrity
and the origin of the package.
PGP configuration information is read from /etc/rpmrc.
See the section on PGP SIGNATURES for details.

.SH REBUILD AND RECOMPILE OPTIONS

There are two other ways to invoke rpm:

.I "\fBrpm \-\-recompile <source_package_file>+\fP"

.I "\fBrpm \-\-rebuild <source_package_file>+\fP"

When invoked this way, rpm installs the named source package, and does
a prep, compile and install.  In addition, \-\-rebuild builds a new
binary package.

.SH SIGNING AN EXISTING RPM

.I "\fBrpm \-\-resign <binary_package_file>+\fP"

This option generates and inserts new signatures for the listed packages.
Any existing signatures are removed.


.SH GENERAL OPTIONS
These options can be used in all the different modes.
.IP "\fB\-vv\fP"
Print lots of ugly debugging information.
.IP "\fB\-\-quiet\fP"
Print as little as possible \- normally only error messages will be
displayed.
.IP "\fB\-\-help\fP"
Print a longer usage message then normal.
.IP "\fB\-\-version\fP"
Print a single line containing the version number of rpm being used.
.IP "\fB\-\-rcfile <file>\fP"
Use \fB<file>\fP instead of \fB/etc/rpmrc\fP and \fB$HOME/.rpmrc\fP.
.IP "\fB\-\-root <dir>\fP"
Use the directory given as top level directory for all operations.

.SH PGP SIGNATURES

In order to use the signature feature RPM must be able to run PGP
(it must be installed and in your path), and it must be able to
find a public key ring with RPM public keys in it.  By default,
RPM looks in /usr/lib/rpm for both pubring.pgp and secring.pgp
(which is used during package builds).  If your key rings are not
located there you must set the following on your /etc/rpmrc

.IP "\fBpgp_path\fP"
Replacement path for /usr/lib/rpm.  Must contain your key rings.
.IP "\fBpgp_pubring\fP"
The full path to your public key ring.
.IP "\fBpgp_secring\fP"
The full path to your secret key ring.
.PP
The bare minimum you need to do to get PGP singature checking working
is install PGP and run the following:

.nf
mkdir -p /usr/lib/rpm
cd /usr/lib/rpm
cp /mnt/crom/RPM-PGP-KEY .
touch config.txt
pgp -ka RPM-PGP-KEY pubring.pgp
.fi

You should then be able to check the signatures of packages produced
by Red Hat Software using rpm \-K.

If you want to be able to sign packages you create yourself, you also
need to create your own public and secret key pair (see the PGP manual).
In addition to the above /etc/rpmrc entries, you should add the following:

.IP "\fBsignature\fP"
The signature type.  Right now only pgp is supported.
.IP "\fBpgp_name\fP"
The name of the "user" whose key you wish to use to sign your packages.
.PP

When building packages you then add \-\-sign to the command line.
You will be prompted for your pass phrase, and your package will
be built and signed.


.SH FILES
.nf
/etc/rpmrc
~/.rpmrc
/var/lib/rpm/packages
/var/lib/rpm/pathidx
/var/lib/rpm/nameidx
/tmp/rpm-*
.fi
.El
.SH SEE ALSO
.IR glint (8) ,
.IR rpm2cpio (8) ,
.B http://www.redhat.com/redhat/support/docs/HOWTO/RPM-HOWTO
.nf
.SH AUTHORS
.nf
Marc Ewing <marc@redhat.com>
Erik Troan <ewt@redhat.com>
.fi