1RPM(8) System Manager's Manual RPM(8)
2
3
4
6 rpm - RPM Package Manager
7
9 QUERYING AND VERIFYING PACKAGES:
10 rpm {-q|--query} [select-options] [query-options]
11
12
13
14 rpm {-V|--verify} [select-options] [verify-options]
15
16
17
18
19 INSTALLING, UPGRADING, AND REMOVING PACKAGES:
20 rpm {-i|--install} [install-options] PACKAGE_FILE ...
21
22
23
24 rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
25
26
27
28 rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
29
30
31
32 rpm {-e|--erase} [--allmatches] [--justdb] [--nodeps] [--noscripts]
33 [--notriggers] [--test] PACKAGE_NAME ...
34
35
36 MISCELLANEOUS:
37 rpm {--querytags|--showrc}
38
39
40
41 rpm {--setperms|--setugids} PACKAGE_NAME ...
42
43
44 select-options
45 [PACKAGE_NAME] [-a,--all] [-f,--file FILE]
46 [-g,--group GROUP] {-p,--package PACKAGE_FILE]
47 [--hdrid SHA1] [--pkgid MD5] [--tid TID]
48 [--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME]
49 [--whatprovides CAPABILITY] [--whatrequires CAPABILITY]
50
51
52 query-options
53 [--changelog] [-c,--configfiles] [--conflicts]
54 [-d,--docfiles] [--dump] [--filesbypkg] [-i,--info]
55 [--last] [-l,--list] [--obsoletes] [--provides]
56 [--qf,--queryformat QUERYFMT] [-R,--requires]
57 [--scripts] [-s,--state] [--triggers,--triggerscripts]
58
59
60 verify-options
61 [--nodeps] [--nofiles] [--noscripts]
62 [--nodigest] [--nosignature]
63 [--nolinkto] [--nofiledigest] [--nosize] [--nouser]
64 [--nogroup] [--nomtime] [--nomode] [--nordev]
65 [--nocaps] [--noconfig] [--noghost]
66
67
68 install-options
69 [--allfiles] [--badreloc] [--excludepath OLDPATH]
70 [--excludedocs] [--force] [-h,--hash]
71 [--ignoresize] [--ignorearch] [--ignoreos]
72 [--includedocs] [--justdb] [--nocollections]
73 [--nodeps] [--nodigest] [--nosignature] [--noplugins]
74 [--noorder] [--noscripts] [--notriggers]
75 [--oldpackage] [--percent] [--prefix NEWPATH]
76 [--relocate OLDPATH=NEWPATH]
77 [--replacefiles] [--replacepkgs]
78 [--test]
79
80
82 rpm is a powerful Package Manager, which can be used to build, install,
83 query, verify, update, and erase individual software packages. A pack‐
84 age consists of an archive of files and meta-data used to install and
85 erase the archive files. The meta-data includes helper scripts, file
86 attributes, and descriptive information about the package. Packages
87 come in two varieties: binary packages, used to encapsulate software to
88 be installed, and source packages, containing the source code and
89 recipe necessary to produce binary packages.
90
91 One of the following basic modes must be selected: Query, Verify,
92 Install/Upgrade/Freshen/Reinstall, Uninstall, Set Owners/Groups, Show
93 Querytags, and Show Configuration.
94
95 GENERAL OPTIONS
96 These options can be used in all the different modes.
97
98 -?, --help
99 Print a longer usage message then normal.
100
101 --version
102 Print a single line containing the version number of rpm being
103 used.
104
105 --quiet
106 Print as little as possible - normally only error messages will
107 be displayed.
108
109 -v Print verbose information - normally routine progress messages
110 will be displayed.
111
112 -vv Print lots of ugly debugging information.
113
114 --rcfile FILELIST
115 Each of the files in the colon separated FILELIST is read
116 sequentially by rpm for configuration information. Only the
117 first file in the list must exist, and tildes will be expanded
118 to the value of $HOME. The default FILELIST is
119 /usr/lib/rpm/rpmrc:/usr/lib/rpm/red‐
120 hat/rpmrc:/etc/rpmrc:~/.rpmrc.
121
122 --pipe CMD
123 Pipes the output of rpm to the command CMD.
124
125 --dbpath DIRECTORY
126 Use the database in DIRECTORY rather than the default path
127 /var/lib/rpm
128
129 --root DIRECTORY
130 Use the file system tree rooted at DIRECTORY for all operations.
131 Note that this means the database within DIRECTORY will be used
132 for dependency checks and any scriptlet(s) (e.g. %post if
133 installing, or %prep if building, a package) will be run after a
134 chroot(2) to DIRECTORY.
135
136 -D, --define='MACRO EXPR'
137 Defines MACRO with value EXPR.
138
139 --undefine='MACRO'
140 Undefines MACRO.
141
142 -E, --eval='EXPR'
143 Prints macro expansion of EXPR.
144
145 INSTALL AND UPGRADE OPTIONS
146 In these options, PACKAGE_FILE can be either rpm binary file or ASCII
147 package manifest (see PACKAGE SELECTION OPTIONS), and may be specified
148 as an ftp or http URL, in which case the package will be downloaded
149 before being installed. See FTP/HTTP OPTIONS for information on rpm's
150 internal ftp and http client support.
151
152 The general form of an rpm install command is
153
154 rpm {-i|--install} [install-options] PACKAGE_FILE ...
155
156 This installs a new package.
157
158 The general form of an rpm upgrade command is
159
160 rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
161
162 This upgrades or installs the package currently installed to a newer
163 version. This is the same as install, except all other version(s) of
164 the package are removed after the new package is installed.
165
166 rpm {-F|--freshen} [install-options] PACKAGE_FILE ...
167
168 This will upgrade packages, but only ones for which an earlier version
169 is installed.
170
171 The general form of an rpm reinstall command is
172
173 rpm {--reinstall} [install-options] PACKAGE_FILE ...
174
175 This reinstalls a previously installed package.
176
177 --allfiles
178 Installs or upgrades all the missingok files in the package,
179 regardless if they exist.
180
181 --badreloc
182 Used with --relocate, permit relocations on all file paths, not
183 just those OLDPATH's included in the binary package relocation
184 hint(s).
185
186 --excludepath OLDPATH
187 Don't install files whose name begins with OLDPATH.
188
189 --excludedocs
190 Don't install any files which are marked as documentation (which
191 includes man pages and texinfo documents).
192
193 --force
194 Same as using --replacepkgs, --replacefiles, and --oldpackage.
195
196 -h, --hash
197 Print 50 hash marks as the package archive is unpacked. Use
198 with -v|--verbose for a nicer display.
199
200 --ignoresize
201 Don't check mount file systems for sufficient disk space before
202 installing this package.
203
204 --ignorearch
205 Allow installation or upgrading even if the architectures of the
206 binary package and host don't match.
207
208 --ignoreos
209 Allow installation or upgrading even if the operating systems of
210 the binary package and host don't match.
211
212 --includedocs
213 Install documentation files. This is the default behavior.
214
215 --justdb
216 Update only the database, not the filesystem.
217
218 --nodigest
219 Don't verify package or header digests when reading.
220
221 --nomanifest
222 Don't process non-package files as manifests.
223
224 --nosignature
225 Don't verify package or header signatures when reading.
226
227 --nodeps
228 Don't do a dependency check before installing or upgrading a
229 package.
230
231 --noorder
232 Don't reorder the packages for an install. The list of packages
233 would normally be reordered to satisfy dependencies.
234
235 --noplugins
236 Do not load and execute plugins.
237
238 --noscripts
239
240 --nopre
241
242 --nopost
243
244 --nopreun
245
246 --nopostun
247 Don't execute the scriptlet of the same name. The --noscripts
248 option is equivalent to
249
250 --nopre --nopost --nopreun --nopostun
251
252 and turns off the execution of the corresponding %pre, %post,
253 %preun, and %postun scriptlet(s).
254
255 --notriggers
256
257 --notriggerin
258
259 --notriggerun
260
261 --notriggerprein
262
263 --notriggerpostun
264 Don't execute any trigger scriptlet of the named type. The
265 --notriggers option is equivalent to
266
267 --notriggerprein --notriggerin --notriggerun --notriggerpostun
268
269 and turns off execution of the corresponding %triggerprein,
270 %triggerin, %triggerun, and %triggerpostun scriptlet(s).
271
272 --oldpackage
273 Allow an upgrade to replace a newer package with an older one.
274
275 --percent
276 Print percentages as files are unpacked from the package ar‐
277 chive. This is intended to make rpm easy to run from other
278 tools.
279
280 --prefix NEWPATH
281 For relocatable binary packages, translate all file paths that
282 start with the installation prefix in the package relocation
283 hint(s) to NEWPATH.
284
285 --relocate OLDPATH=NEWPATH
286 For relocatable binary packages, translate all file paths that
287 start with OLDPATH in the package relocation hint(s) to NEWPATH.
288 This option can be used repeatedly if several OLDPATH's in the
289 package are to be relocated.
290
291 --replacefiles
292 Install the packages even if they replace files from other,
293 already installed, packages.
294
295 --replacepkgs
296 Install the packages even if some of them are already installed
297 on this system.
298
299 --test Do not install the package, simply check for and report poten‐
300 tial conflicts.
301
302 ERASE OPTIONS
303 The general form of an rpm erase command is
304
305 rpm {-e|--erase} [--allmatches] [--justdb] [--nodeps] [--noscripts]
306 [--notriggers] [--test] PACKAGE_NAME ...
307
308
309 The following options may also be used:
310
311 --allmatches
312 Remove all versions of the package which match PACKAGE_NAME.
313 Normally an error is issued if PACKAGE_NAME matches multiple
314 packages.
315
316 --justdb
317 Update only the database, not the filesystem.
318
319 --nodeps
320 Don't check dependencies before uninstalling the packages.
321
322 --noscripts
323
324 --nopreun
325
326 --nopostun
327 Don't execute the scriptlet of the same name. The --noscripts
328 option during package erase is equivalent to
329
330 --nopreun --nopostun
331
332 and turns off the execution of the corresponding %preun, and
333 %postun scriptlet(s).
334
335 --notriggers
336
337 --notriggerun
338
339 --notriggerpostun
340 Don't execute any trigger scriptlet of the named type. The
341 --notriggers option is equivalent to
342
343 --notriggerun --notriggerpostun
344
345 and turns off execution of the corresponding %triggerun, and
346 %triggerpostun scriptlet(s).
347
348 --test Don't really uninstall anything, just go through the motions.
349 Useful in conjunction with the -vv option for debugging.
350
351 QUERY OPTIONS
352 The general form of an rpm query command is
353
354 rpm {-q|--query} [select-options] [query-options]
355
356
357 You may specify the format that package information should be printed
358 in. To do this, you use the
359
360 --qf|--queryformat QUERYFMT
361
362 option, followed by the QUERYFMT format string. Query formats are mod‐
363 ified versions of the standard printf(3) formatting. The format is made
364 up of static strings (which may include standard C character escapes
365 for newlines, tabs, and other special characters) and printf(3) type
366 formatters. As rpm already knows the type to print, the type specifier
367 must be omitted however, and replaced by the name of the header tag to
368 be printed, enclosed by {} characters. Tag names are case insensitive,
369 and the leading RPMTAG_ portion of the tag name may be omitted as well.
370
371 Alternate output formats may be requested by following the tag with
372 :typetag. Currently, the following types are supported:
373
374 :armor Wrap a public key in ASCII armor.
375
376 :arraysize
377 Display number of elements in array tags.
378
379 :base64
380 Encode binary data using base64.
381
382 :date Use strftime(3) "%c" format.
383
384 :day Use strftime(3) "%a %b %d %Y" format.
385
386 :depflags
387 Format dependency comparison operator.
388
389 :deptype
390 Format dependency type.
391
392 :expand
393 Perform macro expansion.
394
395 :fflags
396 Format file flags.
397
398 :fstate
399 Format file state.
400
401 :fstatus
402 Format file verify status.
403
404 :hex Format in hexadecimal.
405
406 :octal Format in octal.
407
408 :perms Format file permissions.
409
410 :pgpsig
411 Display signature fingerprint and time.
412
413 :shescape
414 Escape single quotes for use in a script.
415
416 :triggertype
417 Display trigger suffix.
418
419 :vflags
420 File verification flags.
421
422 :xml Wrap data in simple xml markup.
423
424 For example, to print only the names of the packages queried, you could
425 use %{NAME} as the format string. To print the packages name and dis‐
426 tribution information in two columns, you could use %-30{NAME}%{DISTRI‐
427 BUTION}. rpm will print a list of all of the tags it knows about when
428 it is invoked with the --querytags argument.
429
430 There are two subsets of options for querying: package selection, and
431 information selection.
432
433 PACKAGE SELECTION OPTIONS:
434 PACKAGE_NAME
435 Query installed package named PACKAGE_NAME.
436
437 -a, --all
438 Query all installed packages.
439
440 -f, --file FILE
441 Query package owning FILE.
442
443 -g, --group GROUP
444 Query packages with the group of GROUP.
445
446 --hdrid SHA1
447 Query package that contains a given header identifier, i.e. the
448 SHA1 digest of the immutable header region.
449
450 -p, --package PACKAGE_FILE
451 Query an (uninstalled) package PACKAGE_FILE. The PACKAGE_FILE
452 may be specified as an ftp or http style URL, in which case the
453 package header will be downloaded and queried. See FTP/HTTP
454 OPTIONS for information on rpm's internal ftp and http client
455 support. The PACKAGE_FILE argument(s), if not a binary package,
456 will be interpreted as an ASCII package manifest unless --noman‐
457 ifest option is used. In manifests, comments are permitted,
458 starting with a '#', and each line of a package manifest file
459 may include white space separated glob expressions, including
460 URL's, that will be expanded to paths that are substituted in
461 place of the package manifest as additional PACKAGE_FILE argu‐
462 ments to the query.
463
464 --pkgid MD5
465 Query package that contains a given package identifier, i.e. the
466 MD5 digest of the combined header and payload contents.
467
468 --querybynumber HDRNUM
469 Query the HDRNUMth database entry directly; this is useful only
470 for debugging.
471
472 --specfile SPECFILE
473 Parse and query SPECFILE as if it were a package. Although not
474 all the information (e.g. file lists) is available, this type of
475 query permits rpm to be used to extract information from spec
476 files without having to write a specfile parser.
477
478 --tid TID
479 Query package(s) that have a given TID transaction identifier. A
480 unix time stamp is currently used as a transaction identifier.
481 All package(s) installed or erased within a single transaction
482 have a common identifier.
483
484 --triggeredby PACKAGE_NAME
485 Query packages that are triggered by package(s) PACKAGE_NAME.
486
487 --whatprovides CAPABILITY
488 Query all packages that provide the CAPABILITY capability.
489
490 --whatrequires CAPABILITY
491 Query all packages that require CAPABILITY for proper function‐
492 ing.
493
494 PACKAGE QUERY OPTIONS:
495 --changelog
496 Display change information for the package.
497
498 -c, --configfiles
499 List only configuration files (implies -l).
500
501 --conflicts
502 List capabilities this package conflicts with.
503
504 -d, --docfiles
505 List only documentation files (implies -l).
506
507 --dump Dump file information as follows (implies -l):
508
509
510 path size mtime digest mode owner group isconfig isdoc rdev symlink
511
512
513 --filesbypkg
514 List all the files in each selected package.
515
516 -i, --info
517 Display package information, including name, version, and
518 description. This uses the --queryformat if one was specified.
519
520 --last Orders the package listing by install time such that the latest
521 packages are at the top.
522
523 -L, --licensefiles
524 List only license files (implies -l).
525
526 -l, --list
527 List files in package.
528
529 --obsoletes
530 List packages this package obsoletes.
531
532 --provides
533 List capabilities this package provides.
534
535 -R, --requires
536 List capabilities on which this package depends.
537
538 --scripts
539 List the package specific scriptlet(s) that are used as part of
540 the installation and uninstallation processes.
541
542 -s, --state
543 Display the states of files in the package (implies -l). The
544 state of each file is one of normal, not installed, or replaced.
545
546 --triggers, --triggerscripts
547 Display the trigger scripts, if any, which are contained in the
548 package.
549
550 VERIFY OPTIONS
551 The general form of an rpm verify command is
552
553 rpm {-V|--verify} [select-options] [verify-options]
554
555
556 Verifying a package compares information about the installed files in
557 the package with information about the files taken from the package
558 metadata stored in the rpm database. Among other things, verifying
559 compares the size, digest, permissions, type, owner and group of each
560 file. Any discrepancies are displayed. Files that were not installed
561 from the package, for example, documentation files excluded on instal‐
562 lation using the "--excludedocs" option, will be silently ignored.
563
564 The package selection options are the same as for package querying
565 (including package manifest files as arguments). Other options unique
566 to verify mode are:
567
568 --nodeps
569 Don't verify dependencies of packages.
570
571 --nodigest
572 Don't verify package or header digests when reading.
573
574 --nofiles
575 Don't verify any attributes of package files.
576
577 --noconfig
578 Don't verify config files.
579
580 --noghost
581 Don't display ghost files.
582
583 --noscripts
584 Don't execute the %verifyscript scriptlet (if any).
585
586 --nosignature
587 Don't verify package or header signatures when reading.
588
589 --nolinkto
590
591 --nofiledigest (formerly --nomd5)
592
593 --nosize
594
595 --nouser
596
597 --nogroup
598
599 --nomtime
600
601 --nomode
602
603 --nordev
604 Don't verify the corresponding file attribute.
605
606 The format of the output is a string of 9 characters, a possible
607 attribute marker:
608
609 c %config configuration file.
610 d %doc documentation file.
611 g %ghost file (i.e. the file contents are not included in the package payload).
612 l %license license file.
613 r %readme readme file.
614
615 from the package header, followed by the file name. Each of the 9
616 characters denotes the result of a comparison of attribute(s) of the
617 file to the value of those attribute(s) recorded in the database. A
618 single "." (period) means the test passed, while a single "?" (question
619 mark) indicates the test could not be performed (e.g. file permissions
620 prevent reading). Otherwise, the (mnemonically emBoldened) character
621 denotes failure of the corresponding --verify test:
622
623 S file Size differs
624 M Mode differs (includes permissions and file type)
625 5 digest (formerly MD5 sum) differs
626 D Device major/minor number mismatch
627 L readL[22mink(2) path mismatch
628 U User ownership differs
629 G Group ownership differs
630 T mTime differs
631 P caPabilities differ
632
633
634 MISCELLANEOUS COMMANDS
635 rpm --showrc
636 shows the values rpm will use for all of the options are cur‐
637 rently set in rpmrc and macros configuration file(s).
638
639 rpm --setperms PACKAGE_NAME
640 sets permissions of files in the given package.
641
642 rpm --setugids PACKAGE_NAME
643 sets user/group ownership of files in the given package.
644
645 Options --setperms and --setugids are mutually exclusive.
646
647
648 FTP/HTTP OPTIONS
649 rpm can act as an FTP and/or HTTP client so that packages can be
650 queried or installed from the internet. Package files for install,
651 upgrade, and query operations may be specified as an ftp or http style
652 URL:
653
654 ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm
655
656 If the :PASSWORD portion is omitted, the password will be prompted for
657 (once per user/hostname pair). If both the user and password are omit‐
658 ted, anonymous ftp is used. In all cases, passive (PASV) ftp transfers
659 are performed.
660
661 rpm allows the following options to be used with ftp URLs:
662
663 --ftpproxy HOST
664 The host HOST will be used as a proxy server for all ftp trans‐
665 fers, which allows users to ftp through firewall machines which
666 use proxy systems. This option may also be specified by config‐
667 uring the macro %_ftpproxy.
668
669 --ftpport PORT
670 The TCP PORT number to use for the ftp connection on the proxy
671 ftp server instead of the default port. This option may also be
672 specified by configuring the macro %_ftpport.
673
674 rpm allows the following options to be used with http URLs:
675
676 --httpproxy HOST
677 The host HOST will be used as a proxy server for all http trans‐
678 fers. This option may also be specified by configuring the macro
679 %_httpproxy.
680
681 --httpport PORT
682 The TCP PORT number to use for the http connection on the proxy
683 http server instead of the default port. This option may also be
684 specified by configuring the macro %_httpport.
685
687 Executing rpmbuild
688 The build modes of rpm are now resident in the /usr/bin/rpmbuild exe‐
689 cutable. Install the package containing rpmbuild (usually rpm-build)
690 and see rpmbuild(8) for documentation of all the rpm build modes.
691
693 rpmrc Configuration
694 /usr/lib/rpm/rpmrc
695 /usr/lib/rpm/redhat/rpmrc
696 /etc/rpmrc
697 ~/.rpmrc
698
699 Macro Configuration
700 /usr/lib/rpm/macros
701 /usr/lib/rpm/redhat/macros
702 /etc/rpm/macros
703 ~/.rpmmacros
704
705 Database
706 /var/lib/rpm/Basenames
707 /var/lib/rpm/Conflictname
708 /var/lib/rpm/Dirnames
709 /var/lib/rpm/Group
710 /var/lib/rpm/Installtid
711 /var/lib/rpm/Name
712 /var/lib/rpm/Obsoletename
713 /var/lib/rpm/Packages
714 /var/lib/rpm/Providename
715 /var/lib/rpm/Requirename
716 /var/lib/rpm/Sha1header
717 /var/lib/rpm/Sigmd5
718 /var/lib/rpm/Triggername
719
720 Temporary
721 /var/tmp/rpm*
722
724 popt(3),
725 rpm2cpio(8),
726 rpmbuild(8),
727 rpmdb(8),
728 rpmkeys(8),
729 rpmsign(8),
730 rpmspec(8),
731
732 rpm --help - as rpm supports customizing the options via popt aliases
733 it's impossible to guarantee that what's described in the manual
734 matches what's available.
735
736
737 http://www.rpm.org/ <URL:http://www.rpm.org/>
738
740 Marc Ewing <marc@redhat.com>
741 Jeff Johnson <jbj@redhat.com>
742 Erik Troan <ewt@redhat.com>
743
744
745
746Red Hat, Inc. 09 June 2002 RPM(8)