Linux rpm Command
The Linux rpm command is used to manage packages.
rpm (full spelling in English: Red Hat Package Manager) was originally a program specifically designed for the Red Hat Linux distribution to manage various Linux packages. Due to its adherence to the GPL rules and its powerful and convenient features, it has gained widespread popularity. Gradually, it has been adopted by other distributions. The emergence of RPM package management has made Linux easy to install and upgrade, indirectly enhancing the usability of Linux.
Syntax
rpm [-acdhilqRsv][-b<completion stage><package file>+][-e<package file>][-f<file>+][-i<package file>][-p<package file>+][-U<package file>][-vv][--addsign<package file>+][--allfiles][--allmatches][--badreloc][--buildroot<root directory>][--changelog][--checksig<package file>+][--clean][--dbpath<database directory>][--dump][--excludedocs][--excludepath<exclude directory>][--force][--ftpproxy<host name or IP address>][--ftpport<communication port>][--help][--httpproxy<host name or IP address>][--httpport<communication port>][--ignorearch][--ignoreos][--ignoresize][--includedocs][--initdb][justdb][--nobulid][--nodeps][--nofiles][--nogpg][--nomd5][--nopgp][--noorder][--noscripts][--notriggers][--oldpackage][--percent][--pipe<command>][--prefix<destination directory>][--provides][--queryformat<header format>][--querytags][--rcfile<configuration file>][--rebulid<package file>][--rebuliddb][--recompile<package file>][--relocate<original directory>=<new directory>][--replacefiles][--replacepkgs][--requires][--resign<package file>+][--rmsource][--rmsource<file>][--root<root directory>][--scripts][--setperms][--setugids][--short-circuit][--sign][--target=<installation platform>+][--test][--timecheck<check seconds>][--triggeredby<package file>][--triggers][--verify][--version][--whatprovides<feature>][--whatrequires<feature>]
Parameter Description:
-a Query all packages.
-b<completion stage><package file>+ or -t <completion stage><package file>+ Set the completion stage of package wrapping and specify the file name of the package file.
-c Only list configuration files. This parameter must be used in conjunction with the "-l" parameter.
-d Only list text files. This parameter must be used in conjunction 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.
-h or --hash Display markers when the package is installed.
-i Display information about the package.
-i<package file> or --install<package file> Install the specified package file.
-l Display the list of files in the package.
-p<package file>+ Query the specified RPM package file.
-q Use inquiry mode. When encountering any problems, the rpm command will first ask the user.
-R Display package dependency information.
-s Display file status. This parameter must be used in conjunction with the "-l" parameter.
-U<package file> or --upgrade<package file> Upgrade the specified package file.
-v Display the execution process of the command.
-vv Display detailed execution process of the command, which is convenient for troubleshooting.
--addsign<package file>+ Add new signature authentication to the specified package.
--allfiles Install all files.
--allmatches Delete files included in the package that match the specified package.
--badreloc Reconfigure files when an error occurs.
--buildroot<root directory> Set the directory to be used as the root directory when generating the package.
--changelog Display the change record of the package.
--checksig<package file>+ Verify the signature authentication of the package.
--clean After completing the packaging of the package, delete the directories created during the packaging process.
--dbpath<database directory> Set the directory to store the RPM database.
--dump Display verification information for each file. This parameter must be used in conjunction with the "-l" parameter.
--excludedocs Do not install documentation files when installing the package.
--excludepath<exclude directory> Ignore all files in the specified directory.
--force Forcefully replace packages or files.
--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.
--help Online 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.
--ignorearch Do not verify the structural integrity of the package.
--ignoreos Do not verify the structural integrity of the package.
--ignoresize Do not check disk space before installation.
--includedocs Install documentation files along with the package.
--initdb Ensure there is a correct database available.
--justdb Update the database without changing any files.
--nobulid Do not execute any completion stages.
--nodeps Do not verify package interdependencies.
--nofiles Do not verify file attributes.
--nogpg Skip all GPG signature checks.
--nomd5 Do not use MD5 encoding to verify file size and integrity.
--nopgp Skip all PGP signature checks.
--noorder Do not rearrange the installation order of packages to satisfy interdependencies.
--noscripts Do not execute any installation script files.
--notriggers Do not execute any script files included in the package.
--oldpackage Upgrade to an older version of the package.
--percent Display the completion percentage during package installation.
--pipe<command> Create a pipe, converting output results into input data for the command.
--prefix<destination directory> If reconfiguring files, place them in the specified directory.
--provides Query the compatibility provided by the package.
--queryformat<header format> Set the header representation format.
--querytags List the tags available for header formatting.
--rcfile<configuration file> Use the specified configuration file.
--rebulid<package file> Install the source code package and regenerate the binary package.
--rebuliddb Rebuild the database based on the existing one.
--recompile<package file> This parameter is similar to the "--rebulid" parameter, but does not generate a package file.
--relocate<original directory>=<new directory> Move files that would be placed in the original directory to the new directory.
--replacefiles Forcefully replace files.
--replacepkgs Forcefully replace packages.
--requires Query the compatibility required by the package.
--resing<package file>+ Delete existing signatures and regenerate signature authentication.
--rmsource Delete the source code after packaging the package.
--rmsource<file> Delete the source code and the specified file.
--root<root directory> Set the directory to be used as the root directory.
--scripts List the script variables for the package installation.
--setperms Set file permissions.
--setugids Set file owner and group.
--short-circuit Skip directly over the specified completion stages.
--sign Generate PGP or GPG signature authentication.
--target=<installation platform>+ Set the installation platform for the generated package.
--test Perform a test without actually installing the package.
--timecheck<check seconds> Set the number of seconds for the time check.
--triggeredby<package file> Query the packager of the package.
--triggers Display the packaging scripts included in the package file.
--verify This parameter has the same effect as the "-q" parameter.
--version Display 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.
Example
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: Tutorials, Related Commands】