44bbac234abf0ffe729f79343bc7af9a4272072b
[platform/upstream/rpm.git] / rpm.8
1 .\" rpm - Red Hat Package Manager
2 .TH rpm 8 "15 July 1996" "Red Hat Software" "Red Hat Linux"
3 .SH NAME
4 rpm \- Red Hat Package Manager
5 .SH SYNOPSIS
6 \fBrpm\fP [options] 
7 .SH DESCRIPTION
8 \fBrpm\fP is a powerful \fIpackage manager\fP, which can be used to
9 build, install, query, verify, update, and uninstall individual
10 software packages.  A \fIpackage\fP consists of an archive of files,
11 and package information, including name, version, and description.
12
13 There are ten basic modes of operation, and each takes a different
14 set of options.  They are \fIInstall\fP, \fIQuery\fP,
15 \fIVerify\fP, \fISignature check\fP, \fIUninstall\fP, \fIBuild\fP,
16 \fIRebuild Database\fP, \fIfix permissions\fP, \fIset owners and groups\fR, 
17 and \fIShow RC\fP.
18
19 Install mode:
20 .br
21 .I "\fB    rpm \-i [install\-options] <package_file>+\fP"
22 .br
23 Query mode:
24 .br
25 .I "\fB    rpm \-q [query\-options]\fP"
26 .br
27 Verify mode:
28 .br
29 .I "\fB    rpm \-V|\-y|\-\-verify [verify\-options]\fP"
30 .br
31 Signature Check mode:
32 .br
33 .I "\fB    rpm \-\-checksig <package_file>+\fP"
34 .br
35 Uninstall mode:
36 .br
37 .I "\fB    rpm \-e <package_name>+\fP"
38 .br
39 Build mode:
40 .br
41 .I "\fB    rpm \-[b|t]\fIO\fB [build\-options] <package_spec>+\fP"
42 .br
43 Rebuild database:
44 .br
45 .I "\fB    rpm \-\-rebuilddb"
46 .br
47 Fix permissions:
48 .br
49 .I "\fB    rpm \-\-setperms [query\-package\-specifiers]\fP"
50 .br
51 Set owners and groups:
52 .br
53 .I "\fB    rpm \-\-setugids [query\-package\-specifiers]\fP"
54 .br
55 Show RC:
56 .br
57 .I "\fB    rpm \-\-showrc"
58 .br
59
60 .SH GENERAL OPTIONS
61 These options can be used in all the different modes.
62 .IP "\fB\-vv\fP"
63 Print lots of ugly debugging information.
64 .IP "\fB\-\-keep\-temps\fP"
65 Do not remove temporary files (/tmp/rpm\-*).  Primarily only useful
66 for debugging rpm.
67 .IP "\fB\-\-quiet\fP"
68 Print as little as possible \- normally only error messages will be
69 displayed.
70 .IP "\fB\-\-help\fP"
71 Print a longer usage message then normal.
72 .IP "\fB\-\-version\fP"
73 Print a single line containing the version number of rpm being used.
74 .IP "\fB\-\-rcfile <file>\fP"
75 Use \fB<file>\fP instead of \fB/etc/rpmrc\fP and \fB$HOME/.rpmrc\fP.
76 .IP "\fB\-\-root <dir>\fP"
77 Use the directory given as top level directory for all operations.
78
79 .SH INSTALL OPTIONS
80 The general form of an rpm install command is
81 .PP
82         \fBrpm \-i [install\-options] <package_file>+\fP
83 .PP
84 The <package_file> may be specified as an ftp style URL, in which case
85 the package will be downloaded before being installed. See \fBFTP
86 OPTIONS\fP for information on RPM's built in ftp support.
87 .PP
88 .IP "\fB\-\-force\fP"
89 Same as using both \-\-replacepkgs, \-\-replacefiles, and 
90 \-\-oldpackage.
91 .IP "\fB\-h, \-\-hash\fP"
92 Print 50 hash marks as the package archive is unpacked.  Use
93 with \fB\-v\fP for a nice display.
94 .IP "\fB\-\-oldpackage\fP"
95 Allow an upgrade to replace a newer package with an older one.
96 .IP "\fB\-\-percent\fP"
97 Print percentages as files are unpacked from the package archive. This
98 is intended to make RPM easy to run from other tools.
99 .IP "\fB\-\-replacefiles\fP"
100 Install the packages even if they replace files from other, already
101 installed, packages.
102 .IP "\fB\-\-replacepkgs\fP"
103 Install the packages even if some of them are already installed on this
104 system.
105 .IP "\fB\-\-root \fI<dir>\fP"
106 Do the installation on the system rooted at \fI<dir>\fP.  Note that
107 this means the database will be updated under \fI<dir>\fP and any
108 \fIpre\fP or \fIpost\fP scripts are run after a chroot() to \fI<dir>\fP.
109 .IP "\fB\-\-nodeps\fP"
110 Don't do a dependency check before installing the new package.
111 .IP "\fB\-\-noscripts\fP"
112 Don't execute the preinstall or postinstall scripts.
113 .IP "\fB\-\-excludedocs\fP"
114 Don't install any files which are marked as documentation (which includes
115 man pages and texinfo documents).
116 .IP "\fB\-\-includedocs\fP"
117 Install documentation files. This is only needed if \fIexcludedocs: 1\fP
118 is specified in an rpmrc file.
119 .IP "\fB\-\-nodeps\fP"
120 Don't check dependencies before installing the packages.
121 .IP "\fB\-\-test\fP"
122 Do not install the package, simply check for and report potential
123 conflicts.
124 .IP "\fB\-U, \-\-upgrade\fP"
125 Upgrade the package currently installed to the version in the new RPM.
126 This is the same as install, except all other version of the package
127 are removed from the system.
128
129
130
131 .SH QUERY OPTIONS
132 The general form of an rpm query command is
133 .PP
134         \fBrpm \-q [query\-options]\fP
135 .PP
136 You may specify the format that package information should be printed 
137 in. To do this, you use the \fB\-\-queryformat\fP option, followed by 
138 the format string.
139
140 Query formats are modifed versions of the standard \fBprintf(3)\fP
141 formatting. The format is made up of static strings (which may include
142 standard C character escapes for newlines, tabs, and other special
143 characters) and \fBprintf(3)\fP type formatters. As \fBrpm\fP
144 already knows the type to print, the type specifier must be
145 omitted however, and replaced by the name of the header tag to
146 be printed, enclosed by \fB{}\fP characters. The 
147 \fBRPMTAG_\fP portion of the tag name may be omitted, and the
148 tag name may be preceded by a \fB\-\fP to format the tag as
149 a date if possible.
150
151 For example, to print only the names of the packages queried, you
152 could use \fB%{NAME}\fP as the format string. To print the packages
153 name and distribution information in two columns, you could use
154 \fB%\-30{NAME}%{DISTRIBUTION}\fP.
155
156 \fBrpm\fP will print a list of all of the tags it knows about when
157 it is invoked with the \fB\-\-querytags\fP argument.
158
159 There are two subsets of options for querying: package selection, and
160 information selection.
161
162 Package selection options:
163 .br
164 .IP "\fB\fI<package_name>\fP"
165 Query package named \fB\fI<package_name>\fP.
166 .IP "\fB\-a\fP"
167 Query all packages
168 .IP "\fB\-\-whatrequires \fI<capability>\fP"
169 Query all packages that requires \fI<capability>\fP for proper functioning.
170 .IP "\fB\-\-whatprovides \fI<virtual>\fP"
171 Query all packages that provide the \fI<virtual>\fP capability.
172 .IP "\fB\-f \fI<file>\fP"
173 Query package owning \fI<file>\fP.
174 .IP "\fB\-p \fI<package_file>\fP"
175 Query an (uninstalled) package \fI<package_file>\fP. 
176 The <package_file> may be specified as an ftp style URL, in which case
177 the package header will be downloaded and queried. See \fBFTP
178 OPTIONS\fP for information on RPM's built in ftp support.
179
180 .P
181 Information selection options:
182 .br
183 .IP "\fB\-i\fP"
184 Display package information, including name, version, and description. This
185 uses the \fB\-\-queryformat\fP if one was specified.
186 .IP "\fB\-R\fP"
187 List packages this one depends on (same as \fB\-\-requires\fP).
188 .IP "\fB\-\-provides\fP"
189 List capabilities this package provides.
190 .IP "\fB\-l\fP"
191 List files in package.
192 .IP "\fB\-s\fP"
193 Display the \fIstates\fP of files in the package (implies \fB\-l\fP).  
194 The state of each file is
195 either \fInormal\fP, \fInot installed\fP, or \fIreplaced\fP.
196 .IP "\fB\-d\fP"
197 List only documentation files (implies \fB\-l\fP).  
198 .IP "\fB\-c\fP"
199 List only configuration files (implies \fB\-l\fP).  
200 .IP "\fB\-\-scripts\fP"
201 List the package specific shell scripts that are used as part of the 
202 installation and uninstallation processes, if there are any.
203 .IP "\fB\-\-dump\fP"
204 Dump file information as follows: path size mtime md5sum mode
205 owner group isconfig isdoc rdev symlink. This must be used with
206 at least one of \fB\-l\fP, \fB\-c\fP, \fB\-d\fP.
207
208 .SH VERIFY OPTIONS
209 The general form of an rpm verify command is
210 .PP
211         \fBrpm \-V|\-y|\-\-verify [verify\-options]\fP
212 .PP
213 Verifying a package compares information about the installed
214 files in the package with information about the files taken from the
215 original package and stored in the rpm database.  Among other things,
216 verifying compares the size, MD5 sum, permissions, type, owner and group
217 of each file.  Any discrepencies are displayed.  The package specification
218 options are the same as for package querying.
219
220 Files that were not installed from the package, for example documentation
221 files excluded on installation using the "\fB\-\-excludedocs\fP" option,
222 will be silently ignored.
223
224 The format of the output is a string of 8 characters, a possible "\fBc\fP"
225 denoting a configuration file, and then the file name.  Each of the 8
226 characters denotes the result of a comparison of one attribute of the file
227 to the value of that attribute recorded in the RPM database.  A 
228 single "\fB.\fP" (period) means the test passed.  The following characters 
229 denote failure of certain tests:
230
231 .IP "\fB5\fP"
232 MD5 sum
233 .IP "\fBS\fP"
234 File size
235 .IP "\fBL\fP"
236 Symlink
237 .IP "\fBT\fP"
238 Mtime
239 .IP "\fBD\fP"
240 Device
241 .IP "\fBU\fP"
242 User
243 .IP "\fBG\fP"
244 Group
245 .IP "\fBM\fP"
246 Mode (includes permissions and file type)
247
248 .SH SIGNATURE CHECKING
249 The general form of an rpm signature check command is
250 .PP
251         \fBrpm \-\-checksig <package_file>+\fP
252 .PP
253 This checks the PGP signature built into a package to ensure the integrity
254 and the origin of the package.
255 PGP configuration information is read from /etc/rpmrc.
256 See the section on PGP SIGNATURES for details.
257
258 .SH UNINSTALL OPTIONS
259 The general form of an rpm uninstall command is
260 .PP
261         \fB    rpm \-e <package_name>+\fP
262 .PP
263 .IP "\fB\-\-noscripts\fP"
264 Don't execute the preuninstall or postuninstall scripts.
265 .IP "\fB\-\-nodeps\fP"
266 Don't check dependencies before uninstalling the packages.
267 .IP "\fB\-\-test\fP"
268 Don't really uninstall anything, just go through the motions. 
269 \fB\-vv\fP option.
270 .IP "\fB\-\-nodeps\fP"
271 Don't check for broken dependencies before removing the package.
272
273 .SH BUILD OPTIONS
274 The general form of an rpm build command is
275 .PP
276     \fBrpm \-[b|t]\fIO\fP [build\-options] <package_spec>+\fP
277 .PP
278 The argument used is \fB-b\fR if a spec file is being used to build the package
279 and \fB-t\fR if \fBRPM\fR should look inside of a gzipped (or compressed) tar
280 file for the spec file to use. After the first argument, the next argument
281 (\fIO\fR) specifies the stages of building and packaging to be done and
282 is one of:
283
284 .IP "\fB\-bp\fP"
285 Executes the "%prep" stage from the spec file.  Normally this
286 involves unpacking the sources and applying any patches.
287 .IP "\fB\-bl\fP"
288 Do a "list check".  The "%files" section from the spec file
289 is macro expanded, and checks are made to insure the files
290 exist.
291 .IP "\fB\-bc\fP"
292 Do the "%build" stage from the spec file (after doing the prep stage).
293 This generally involves the equivalent of a "make".
294 .IP "\fB\-bi\fP"
295 Do the "%install" stage from the spec file (after doing the prep
296 and build stages).  This generally involves the equivalent of a
297 "make install".
298 .IP "\fB\-bb\fP"
299 Build a binary package (after doing the prep, build, and install stages).
300 .IP "\fB\-ba\fP"
301 Build binary and source packages (after doing the prep, build, and 
302 install stages).
303 .PP
304 The following options may also be used:
305 .IP "\fB\-\-short\-circuit\fP"
306 Skip straight to specified stage (ie, skip all stages leading up
307 to the specified stage).  Only valid with \fB\-bc\fP and \fB\-bi\fP.
308 .IP "\fB\-\-timecheck\fP"
309 Set the "timecheck" age (0 to disable).  This value can also
310 be set in rpmrc with "timecheck:".  The timecheck value expresses,
311 in seconds, the maximum age of a file being packaged.  Warnings
312 will be printed for all files beyond the timecheck age.
313 .IP "\fB\-\-clean\fP"
314 Remove the build tree after the packages are made.
315 .IP "\fB\-\-test\fP"
316 Do not execute any build stages.
317 Useful for testing out spec files.
318 .IP "\fB\-\-sign\fP"
319 Embed a PGP signature in the package.  This signature can be used
320 to verify the integrity and the origin of the package.  See the
321 section on PGP SIGNATURES for /etc/rpmrc details.
322
323 .SH REBUILD AND RECOMPILE OPTIONS
324
325 There are two other ways to invoke rpm:
326
327 .I "\fBrpm \-\-recompile <source_package_file>+\fP"
328
329 .I "\fBrpm \-\-rebuild <source_package_file>+\fP"
330
331 When invoked this way, rpm installs the named source package, and does
332 a prep, compile and install.  In addition, \fB\-\-rebuild\fP builds a new
333 binary package. When the build has completed, the build directory is
334 removed (as in \fB\-\-clean\fP) and the the sources and spec file for
335 the package are removed.
336
337 .SH SIGNING AN EXISTING RPM
338
339 .I "\fBrpm \-\-resign <binary_package_file>+\fP"
340
341 This option generates and inserts new signatures for the listed packages.
342 Any existing signatures are removed.
343
344 .SH PGP SIGNATURES
345
346 In order to use the signature feature RPM must be able to run PGP
347 (it must be installed and in your path), and it must be able to
348 find a public key ring with RPM public keys in it.  By default,
349 RPM uses the PGP defaults to find the keyrings (honoring PGPPATH).
350 If your key rings are not located where PGP expects them to be,
351 you must set the following in your /etc/rpmrc
352
353 .IP "\fBpgp_path\fP"
354 Replacement path for /usr/lib/rpm.  Must contain your key rings.
355 .PP
356
357 If you want to be able to sign packages you create yourself, you also
358 need to create your own public and secret key pair (see the PGP manual).
359 In addition to the above /etc/rpmrc entries, you should add the following:
360
361 .IP "\fBsignature\fP"
362 The signature type.  Right now only pgp is supported.
363 .IP "\fBpgp_name\fP"
364 The name of the "user" whose key you wish to use to sign your packages.
365 .PP
366
367 When building packages you then add \-\-sign to the command line.
368 You will be prompted for your pass phrase, and your package will
369 be built and signed.
370
371 .SH REBUILD DATABASE OPTIONS
372
373 The general form of an rpm rebuild database command is
374 .PP
375         \fBrpm \-\-rebuilddb\fP
376 .PP
377
378 The only options this mode supports are \fB-\-dbpath\fP and \fB-\-root\fP.
379
380 .SH SHOWRC 
381
382 Running 
383
384 .PP
385         \fBrpm \-\-showrc\fP
386
387 .PP
388 shows the values RPM will use for all of the options that may be set
389 in \fIrpmrc\fP files.
390
391 .SH FTP OPTIONS
392
393 RPM includes a simple FTP client to simplify installing and querying packages 
394 which are available over the internet. Package files for install, upgrade,
395 and query operations may be specified as an ftp style URL:
396
397 .PP
398         \fBftp://<user>:<password>@hostname/path/to/package.rpm\fP
399 .PP
400 If the \fB@password\fP portion is omitted, the password will be prompted
401 for (once per user/hostname pair). If both the user and password are
402 omitted, anonymous ftp is used. In all cases passive (PASV) ftp transfers are
403 used.
404
405 RPM allows the folowing options to be used with ftp URLs:
406
407 .IP "\fB\--ftpproxy <hostname>\fP"
408 The host <hostname> will be used as a proxy server for all transfers, which
409 allows users to ftp through firewall machines which use proxy systems.  This
410 option may also be specified in an \fIrpmrc\fP file.
411
412 .IP "\fB\--ftpport <port>\fP"
413 Specifies the TCP port number to use for the ftp connection instead of
414 the default port.
415 This option may also be specified in an \fIrpmrc\fP file.
416
417 .SH FILES
418 .nf
419 /etc/rpmrc
420 ~/.rpmrc
421 /var/lib/rpm/packages
422 /var/lib/rpm/pathidx
423 /var/lib/rpm/nameidx
424 /tmp/rpm*
425 .fi
426 .El
427 .SH SEE ALSO
428 .IR glint (8) ,
429 .IR rpm2cpio (8) ,
430 .B http://www.redhat.com/rpm
431 .nf
432 .SH AUTHORS
433 .nf
434 Marc Ewing <marc@redhat.com>
435 Erik Troan <ewt@redhat.com>
436 .fi