Linux rpm Command
The Linux rpm command is used to manage packages.
rpm (full name in English: redhat package manager) was originally a program specifically designed for Red Hat Linux distributions to manage Linux packages. Because it follows GPL rules and is powerful, convenient, it became widely popular. It has gradually been adopted by other distributions. The appearance of the RPM package management method made Linux easy to install and upgrade, indirectly improving Linux's applicability.
Syntax
rpm [-b<completion stage><package file>+][-e<package file>][-f<file>+][-i<package file>][-p<package file>+][-U<package file>][--addsign<package file>+][--buildroot<root directory>][--checksig<package file>+][--dbpath<database directory>][--excludepath<excluded directory>][--ftpproxy<host name or IP address>][--ftpport<communication port>][--httpproxy<host name or IP address>][--httpport<communication port>][--pipe<executed command>][--prefix<destination directory>][--queryformat<header format>][--rcfile<configuration file>][--rebulid<package file>][--recompile<package file>][--relocate<original directory>=<new directory>][--resign<package file>+][--rmsource<file>][--root<root directory>][--target=<installation platform>+][--timecheck<check seconds>][--triggeredby<package file>][--whatprovides<feature>][--whatrequires<feature>]
Parameter Description:
-aQuery all packages.-b<completion stage><package file>+or-t <completion stage><package file>+Set the completion stage for building the package and specify the file name of the package file.-cList only configuration files. This parameter must be used with the "-l" parameter.-dList only text files. This parameter must be used with the "-l" parameter.-e<package file>or--erase<package file>Delete the specified package.-f<file>+Query the package that owns the specified file.-hor--hashDisplay markers during package installation.-iDisplay information about the package.-i<package file>or--install<package file>Install the specified package file.-lDisplay the file list of the package.-p<package file>+Query the specified RPM package file.-qUse query mode; when encountering any problem, the rpm command will first ask the user.-RDisplay dependency information of the package.-sDisplay file status. This parameter must be used with the "-l" parameter.-U<package file>or--upgrade<package file>Upgrade the specified package file.-vDisplay the command execution process.-vvDisplay the command execution process in detail for troubleshooting.--addsign<package file>+Add a new signature authentication to the specified package.--allfilesInstall all files.--allmatchesDelete files contained in the specified package.--badrelocReconfigure files when an error occurs.--buildroot<root directory>Set the directory to be used as the root directory when generating the package.--changelogDisplay the change log of the package.--checksig<package file>+Verify the signature authentication of the package.--cleanDelete directories created during the packaging process after completing the package build.--dbpath<database directory>Set the directory where the RPM database is to be stored.--dumpDisplay verification information for each file. This parameter must be used with the "-l" parameter.--excludedocsDo not install documentation when installing the package.--excludepath<excluded directory>Ignore all files in the specified directory.--forceForce replacement of a package or file.--ftpproxy<host name or IP address>Specify an FTP proxy server.--ftpport<communication port>Set the communication port used by the FTP server or proxy server.--helpOnline help.--httpproxy<host name or IP address>Specify an HTTP proxy server.--httpport<communication port>Set the communication port used by the HTTP server or proxy server.--ignorearchDo not verify the structural correctness of the package file.--ignoreosDo not verify the structural correctness of the package file.--ignoresizeDo not check if disk space is sufficient before installation.--includedocsInstall documentation along with the package.--initdbConfirm that a correct database is available.--justdbUpdate the database without making any file changes.--nobulidDo not execute any completion stages.--nodepsDo not verify the interdependencies of the package file.--nofilesDo not verify file attributes.--nogpgSkip all GPG signature authentication.--nomd5Do not use MD5 encoding to verify file size and correctness.--nopgpSkip all PGP signature authentication.--noorderDo not re-sequence package installation order to satisfy their dependencies.--noscriptsDo not execute any installation script files.--notriggersDo not execute any script files within the package.--oldpackageUpgrade to an older version of the package.--percentDisplay the completion percentage during package installation.--pipe<executed command>Create a pipe and redirect the output to the input data of the executed command.--prefix<destination directory>If reconfiguring files, place them in the specified directory.--providesQuery the compatibility provided by the package.--queryformat<header format>Set the display format for the header.--querytagsList tags available for header format.--rcfile<configuration file>Use the specified configuration file.--rebulid<package file>Install the source code package and regenerate the binary package.--rebuliddbRebuild a database based on the existing database.--recompile<package file>The effect of this parameter is similar to specifying the "--rebulid" parameter, but does not generate a package file.--relocate<original directory>=<new directory>Move files that would have been placed in the original directory to the new directory.--replacefilesForce file replacement.--replacepkgsForce package replacement.--requiresQuery the compatibility required by the package.--resign<package file>+Delete existing authentication and regenerate the signature authentication.--rmsourceDelete source code after completing the package build.--rmsource<file>Delete source code and the specified file.--root<root directory>Set the directory to be used as the root directory.--scriptsList the script variables for installing the package.--setpermsSet file permissions.--setugidsSet file owner and group.--short-circuitSkip the steps of the specified completion stage directly.--signGenerate a PGP or GPG signature authentication.--target=<installation platform>+Set the installation platform for the generated package.--testOnly test, do not actually install the package.--timecheck<check seconds>Set the timer seconds for the time check.--triggeredby<package file>Query the packager of the package.--triggersDisplay the packaging scripts within the package file.--verifyThe effect of this parameter is the same as specifying the "-q" parameter.--versionDisplay version information.--whatprovides<feature>Query the compatibility provided by the package for the specified feature.--whatrequires<feature>Query the compatibility required by the package for the specified feature.
Examples
Install software
# rpm -hvi dejagnu-1.4.2-10.noarch.rpm
warning: dejagnu-1.4.2-10.noarch.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
Display software installation information
# rpm -qi dejagnu-1.4.2-10.noarch.rpm
γFirst update: Tutorial, similar command associationγ
YouTip