rpm
rpm
Section: Red Hat Linux (8)
Name
RPM - Red Hat Pack Manager
Summation
RPM [option]
description
RPM is a very useful package manager that can be used to generate, install, query, verify, update, and uninstall a single package. A package usually includes a file file and about packages
Information, such as name, version, description, etc.
You must select one of the following basic modes: initialize the database, regenerate the database, generate a package, recompile the package, generate an RPM package, query, display query tab from the TAR package
Pack, update, uninstall, verify, signature check, reemplay, add signature, set owner and group, and display configuration.
database maintenance:
rpm -i [--initdb]
Rpm -i [--rebuilddb]
generate:
RPM [-b | t] [package_spec]
RPM [--Rebuild] [SourcePM]
RPM [--TARBUILD] [TarredSource]
Inquire:
RPM [--query] [queryoption]
RPM [--querytags]
Maintain the installed package:
RPM [--NSTALL] [InstallOptions] [package_file]
RPM [--freshen | -f] [installoptions] [package_file]
RPM [--uninstall | -e] [uninstallOptions] [package]
RPM [--Verify | -v] [VerifyOptions] [Package]
signature:
RPM [--Verify | -v] [VerifyOptions] [Package]
RPM [--Resign] [package_file]
RPM [-addsign] [package_file]
Miscellaneous:
RPM [--SHOWRC]
RPM [--SETPERMS] [Package]
RPM [--SETGIDS] [Package]
Ordinary option
These options can be used in a variety of different ways.
-VV
Many difficult-to-read debugging information will be printed.
--quiet
Print as little information - Normal display only error messages.
--help
Give more usage information than regular.
--Version
Give the version number of RPM used in a single line
--rcfile
List some files in
/usr/lib/rpm/rpmrc:/etc/rpmrc: ~/.rpmrc. The first file in the list (/ usr / lib / rpm / rpmrc) and only this file must exist, transparent ~ point
$ HOME value.
--root
Both all operations will be "Dir> as the root directory of the system. Note that this means that the read or modification operation of the database will be in the
Working is done after doing Chroot () () with
--Dbpath
Use RPM's database in accordance with
--justdb
Update only for the database instead of the entire file system.
- FTPPROXY
Set
- FTPPORT
Set
--PIPE
Enter the output of the RPM to the command
The usual rpm installation command is as follows:
RPM -I [Install-Options]
This will install a new package. The usual RPM upgrade command is as follows:
RPM -U [Install-Options]
This will install the currently installed package upgrade or newly installed RPM version. Upgrade and installation are the same, the difference is that the upgrade wants to remove all other versions of the package from the system.
RPM [-f | --freshen] [install-options]
This is also upgraded, but only this way is used when there is an earlier version of the system.
If you want to download before installation,
You can refer to the FTP / HTTP option.
--force
With the use -ReplacePkgs, - ReplaceFiles, and - LLDPackage effects
-H, --hash
If the package is not unbealed, print 50 broken numbers. Match -V use can make it better show.
--OLDPACKAGE
Allows replace newers with older versions.
--Percent
Give the file from the percentage of the package unpacking. The role of this is to make RPM more easily than other tools.
--ReplaceFiles
Even if you want to install the package to replace the files of other installed packets, the package is also installed.
--ReplacePkgs
Even if the part of the package is installed in the system, the package is also installed.
--allfiles
Install or upgrade all the missing files in the package, regardless of whether it is present.
--Nodeps
Don't do a dependency check before installing or upgrading the package.
--Noscripts
No script before installation or after installation
--Notriggers
No scripts excited by the installation of the package
--IgnoreSize
Do not check if the mount file system has enough disk space before installing the package.
--Excludepath
Do not install file names with files starting with path
--excludedocs
Do not install any files marked as documentation (including man page and text information file).
- Includedocs
Install the document file, this is the default operation.
--Test
No package, just simply check and report possible conflicts.
--Ignorearch
Allows the installation or upgrade its system with the binary RPM package that does not match the host.
--Ignoreos
Allow installation or upgrade its operating system with a binary RPM package that does not match the host.
--Prefix
For a float package, this will set the installation prefix to
--Relocate
Change the file from
--badreloc
Used with -relocate, forcibly modify the unfunctuous package.
--Noorder
When installing, the package is not reordered, and the package list should be re-sorted when installing to meet dependence.
Query option
The RPM query command usually format is as follows:
RPM -Q [Query-Options]
You can make a print format of the package information, then use the [--queryformat | -qf] option, the format string follows the option.
The query format is determined by the version of the standard printf (3) format. The format is static string (including standard C characters other than newline characters, Tab, and other special characters),
And Printf (3) type format. If rpm already knows the print type, the type description must be ignored, and replaced with the name of the head TAG to be printed, the name is enclosed in
Between {}. And the RPMTAG_ section of the TAG is also ignored.
You can use: TypetAg to change the output format. Currently supports with the following types: Octal, Date, Shescape, Perms, Fflags, and DEPFLAGS. For example, to print the name of the query package, you can use% {Name} as a format string To print the package and distribution information in both columns, you can use% -30 {name}% {distribution}.
RPM will list all tags when the QueryTags parameter is excited.
The query option has two sub-settings: package selection and information selection.
Package selection option:
Query the installation package named
-a, --all
Query all installed packages.
--WhatRequires
Query all packages that need
--WhatProvides
Query all packages that provide
-f
Query the package with file
-g
The query belongs to ??? group
-p
Query a package
For information on FTP and HTTP clients, see FTP / HTTP OPTIONS
--Specfile
Like a package, the same PARSE and query
Parser is extracted from the SPEC Files.
- QueryBynumber
Query the
--TriggeredBy
The query is made by the package of
Information Selection Options:
-i
Display package information, including name, version, and description.???
-R, --Requires
List other packages dependent on the package.
--Provides
List the functions provided by the package.
--changelog
Display the change information of the package.
-L, --List
List the files of the package.
-S, --State
Show the status information of each file of the package, so this option is actually implied. The file status can be one of the following: Normal, Not Installed, or Replaced.
-d, - Docfiles
Only document files (implicit -l option) are listed.
-c, --configfiles
Only the configuration file (implicit -l option) is listed.
--Scripts
If any, the special shell script is listed as part of the installation or uninstall process.
--Triggers, --Triggerscripts
If there is, the excitation script containing the package is displayed.
-dump
Duggle file information as follows: Path Size Mtime Md5Sum Mode Owner Group Isconfig Isdoc RDEV SYMLINK. This option must be at least one of the following options.
: -l, -c, -d.
--last
Sort by the installation time of the package, which makes the latest package on the top of the sequence.
--querybypkg
List all files in each package.
--Triggerscripts
Display all excitation scripts of the selected package.
Verify
Rpm -v | -y | --verify [verify-options]]
Compare the file information of the package and the file information of the source package and the file information of the RPM database to verify the package. For other things, then any differences
Will display. The instructions for the package are the same as the query option.
For documents that are not from the package installed, for example, in the installation of the document file, the document file is excluded from the "--exCludedocs" option will be ignored without the prompt. The verification option can be used as the following mode:
--nofiles
Ignore the missing file when verified
--nomd5
Ignore the MD5 check error when verifying
--NOPGP
Ignore the PGP check error when verifying
--nofiles
Ignore the missing file when verified
The output format is a string of eight characters, and a possible "C", indicating that the following is a configuration file, as well as the following file name. Each of the eight characters representative
A comparison result for a file attribute with the properties record value saved in the RPM database. Single "." (Period) indicates that the check is passed. The following characters represent the failure of a specific check:
5
MD5 checksum
S
File size
L
Symbolic connection
T
Change the time
Di
equipment
U
user
G
group
M
Mode (including license and file type)
Signature check
The usual RPM signature check command is as follows:
RPM --Checksig
This will check the PGP signature of the package
Uninstall option
The usual format of the RPM uninstall command is as follows:
RPM -E
- AlLmatches
The packets that are mounted with
--Noscripts
Do not perform the installation or post-installation script.
--Notriggers
Do not perform scripts caused by removing the package
--Nodeps
Do not check dependencies before uninstallation
--Test
Don't really uninstall anything, just traverse this action. It works with the -vv option.
Election option
The General Form of an RPM Build Command IS
RPM - [B | T] o [Build-Options]
The argument use is -b if a spec file is being used to build the package and -t if rpm shouth ins
Gzipped (or compressed) Tar File for the spec file to use. after the first argument, The next argument (o) Specifies
The Stages Of Building and Packaging to Be Done and is one of: RPM usually generated options:
RPM - [B | T] o [Build-Options]
-bp
EXECUTES The "% Prep" stage from the spec file. Normally this involves unpacking the source and applying any patches.
-bl
Do a "List Check". The "% files" section from the spec file is macro expanded, and checks are master to verify That Each
File exisss.
-BC
Do The "% Build" stage from the spec file (after doing the preput). This Generally Involves The Equivalent of A
"Make".
-bi
Do The "% Install" Stage from The Spec File (After Doying The Prep and Build Stages). This Generally Involves theequivalent of a "make install".
-BB
Generate a binary package (after completing the pred, build, and the install phase)
-BS
Only generate a source package (after completing pre-preme, after the install phase)
-bA
Generate binary bags and source packages (after completing preP, build, and the install phase)
The options you can use are as follows:
--Short-Circuit
Ignore the Specified phase (for example, ignoring all the phases that cause the specified phase). Only the -bc and -bi are only valid.
--TimeCheck
Set the value of "timeCheck" (0-?). This value can also be configured by defining the macro "_timecheck". The timeCheck value is in seconds, indicating a maximum age of a package generation. If
The time exceeds this value, the warning information is given to all files.
--clean
After the package is completed, remove the spanning tree.
--RMSource
After the generation of the package is completed, the source and the SPEC file (can also be used alone, such as "rpm --rmsource foo.spec").
--Test
No generated phase is not performed. It is useful when testing the SPEC file.
- Sign
Embed a PGP signature in the package. This signature can be used to verify the integrity and source of the package. The configuration details can be checked in the PGP signature section.
--BUILDROOT
When generating a package, the root directory TAG is generated with the catalog
--Target
When generating a package,
--BUILDARCH
When generating a package, set Architecture to
--BUILDOS
When generating a package, set Architecture to
Regeneration and recompilation options
There Are Two Other Ways To Invoke Building with RPM: There are two different ways to regenerate packages with rpm:
RPM --Recompile
RPM --Rebuild
When excited in this way, the RPM mounted the specified source package, and completes PREP, Compile, Install. In addition, - Rebuild generates a new binary package. When the package
When generating is completed, generate the catalog used (as used as -clean), and the source of the package and the SPEC file are also removed.
Signature an existing RPM
RPM --Resign
This option is generated and inserts a new signature into the list listed. Exested signatures will be removed.
RPM --Addsign
This option is generated and attached to the new signature to the signature listed package.
PGP signature
To use the signature feature, RPM must be able to run PGP (to install PGP and you can access it), but also PGP can find a public key ring with RPM public key. By default
Next, RPM uses PGP's default settings to find the key. If your key is not expected to be in place, you need to configure macro
_PGP_PATH
Set it to the location where the PGP key to be used. If you want to sign a package you generate, you must also create your own public key and key pair (see the PGP manual). You also need to configure the signature type Macro:
_Signature,
Currently only support PGP. There is also a user name Hong:
_PGP_NAME
Indicates users who want to use their keys to sign your package.
When generating a package, you can add-Sign to the command line. This only needs to give your password phrase, you can sign it while generating a package.
For example, if you want to use the user "John Doe
% _Signature
PGP
% _PGP_NAME
/etc/rpm/.pgp
% _PGP_NAME
John Doe
Includes in a macro configuration file. For the configuration of the system, you can use / etc / rpm / macros, and you can use ~ / .rpmmacros for personal configuration.
Regenerate database options
The command of the RPM rebuild the database is
RPM --Rebuilddb
To rebuild a new database, you can:
RPM --initdb
The only option for these modes is --Dbpath and --root.
Showrc
run
RPM --Showrc
Display some values set in the rpmrc file, all options for RPM use these values.
FTP / HTTP option
RPM includes simple FTP and HTTP client programs, which simplifies the installation and query from the package acquired from the Internet. Used for installation, upgrade, and query the package file
Take an explanation of URLs in FTP or HTTP format:
FTP: //
If you ignore: Password section, you will be prompted to give the export (each user / hostname is once) If the username and password are ignored, you will use anonymous FTP. Always use the elimination
Polar (PASV) FTP transfer.
RPM allows the following operation auxiliary FTP URLS
- FTPPROXY
Host
Indicate by configuring macro _ftpproxy.
- FTPPORT
Use this TCP
RPM allows the following operations to assist HTTP URLs
- Hosttpproxy
Use the host
--httpport
Use this TCP
file
/ usr / lib / rpm / rpmrc
/ ETC / RPMRC
~ / .rpmrc
/ var / lib / rpm / packages
/ var / lib / rpm / pathidx
/ var / lib / rpm / nameidx
/ TMP / RPM *
See another
GLINT (8), RPM2CPIO (8), http://www.rpm.org/
Author
Marc ewing
Jeff johnson
Erik Troan
[Chinese version of the maintenance person]
Mapping
[Chinese version latest update]
2001/7/21
"Linuxfourm" in Chinese Man-Page Program
http://cmpp.linuxforum.net