Linux rpm Command
The Linux rpm command is used to manage packages.
rpm (full English spelling: redhat package manager) was originally a program used specifically by the Red Hat Linux distribution to manage the various Linux packages. Because it follows the GPL rules and is powerful and convenient, it gained wide popularity. It was gradually adopted by other distributions. The emergence of RPM package management made Linux easy to install and upgrade, indirectly improving the applicability of Linux.
Syntax
rpm [-acdhilqRsv][-b<完成阶段><套间档>+][-e<套件挡>][-f<文件>+][-i<套件档>][-p<套件档>+][-U<套件档>][-vv][--addsign<套件档>+][--allfiles][--allmatches][--badreloc][--buildroot<根目录>][--changelog][--checksig<套件档>+][--clean][--dbpath<数据库目录>][--dump][--excludedocs][--excludepath<排除目录>][--force][--ftpproxy<主机名称或IP地址>][--ftpport<通信端口>][--help][--httpproxy<主机名称或IP地址>][--httpport<通信端口>][--ignorearch][--ignoreos][--ignoresize][--includedocs][--initdb][justdb][--nobulid][--nodeps][--nofiles][--nogpg][--nomd5][--nopgp][--noorder][--noscripts][--notriggers][--oldpackage][--percent][--pipe<执行指令>][--prefix<目的目录>][--provides][--queryformat<档头格式>][--querytags][--rcfile<配置档>][--rebulid<套件档>][--rebuliddb][--recompile<套件档>][--relocate<原目录>=<新目录>][--replacefiles][--replacepkgs][--requires][--resign<套件档>+][--rmsource][--rmsource<文件>][--root<根目录>][--scripts][--setperms][--setugids][--short-circuit][--sign][--target=<安装平台>+][--test][--timecheck<检查秒数>][--triggeredby<套件档>][--triggers][--verify][--version][--whatprovides<功能特性>][--whatrequires<功能特性>]
Parameter Description:
- -a Query all packages.
- -b
+ or -t + Set the completion stage for building the package, and specify the package file name. - -c Only list configuration files; this parameter must be used with the "-l" parameter.
- -d Only list text (documentation) files; this parameter must be used with the "-l" parameter.
- -e
or --erase Delete the specified package. - -f
+ Query the package that owns the specified file. - -h or --hash List hash marks during package installation.
- -i Display information about the package.
- -i
or --install Install the specified package file. - -l Display the list of files in the package.
- -p
+ Query the specified RPM package file. - -q Use query mode; when any problem is encountered, the rpm command will prompt the user first.
- -R Display dependency information for the package.
- -s Display file status; this parameter must be used with the "-l" parameter.
- -U
or --upgrade Upgrade the specified package file. - -v Display the command execution process.
- -vv Display the command execution process in detail to facilitate troubleshooting.
- -addsign
+ Add a new signature to the specified package. - --allfiles Install all files.
- --allmatches Delete all files contained in packages matching the specification.
- --badreloc Reconfigure files when an error occurs.
- --buildroot
Set the directory to be used as the root directory when building the package. - --changelog Display the change log of the package.
- --checksig
+ Verify the signature of the package. - --clean After building the package, delete the directories created during the build process.
- --dbpath
Set the directory where the RPM database is stored. - --dump Display verification information for each file. This parameter must be used with the "-l" parameter.
- --excludedocs Do not install documentation files when installing the package.
- --excludepath
Ignore all files in the specified directory. - --force Force the replacement of packages or files.
- --ftpproxy
Specify the FTP proxy server. - --ftpport
Set the communication port used by the FTP server or proxy server. - --help Online help.
- --httpproxy
Specify the HTTP proxy server. - --httpport
Set the communication port used by the HTTP server or proxy server. - --ignorearch Do not verify the correctness of the package structure.
- --ignoreos Do not verify the correctness of the package structure.
- --ignoresize Do not check whether there is enough disk space before installation.
- --includedocs Install documentation files together with the package.
- --initdb Ensure that a correct database is available for use.
- --justdb Update the database without changing any files.
- --nobulid Do not execute any completion stages.
- --nodeps Do not verify dependencies between packages.
- --nofiles Do not verify file attributes.
- --nogpg Skip all GPG signature verifications.
- --nomd5 Do not use MD5 checksum computation to verify file size and correctness.
- --nopgp Skip all PGP signature verifications.
- --noorder Do not reorder the installation sequence of packages to satisfy their mutual dependencies.
- --noscripts Do not execute any installation script files.
- --notriggers Do not execute any script files within the package.
- --oldpackage Upgrade to an older version of the package.
- --percent Display the completion percentage during package installation.
- --pipe
Create a pipe that converts the output into input data for that command. - --prefix
When reconfiguring files, place them in the specified directory. - --provides Query the compatibility provided by the package.
- --queryformat
Set the way the header is represented. - --querytags List the tags that can be used in header formats.
- --rcfile
Use the specified configuration file. - --rebulid
Install a source-code package and rebuild the binary package. - --rebuliddb Rebuild a database based on the existing one.
- --recompile
This parameter has an effect similar to the "--rebulid" parameter, but does not produce a package file. - --relocate
= Place files that would have gone into the old directory into the new directory instead. - --replacefiles Force the replacement of files.
- --replacepkgs Force the replacement of packages.
- --requires Query the compatibility required by the package.
- --resing
+ Remove the existing signature and generate a new one. - --rmsource After building the package, delete the source code.
- --rmsource
Delete the source code and the specified files. - --root
Set the directory to be used as the root directory. - --scripts List the script variables of the installation package.
- --setperms Set file permissions.
- --setugids Set the owner and group of files.
- --short-circuit Directly skip the steps of the specified completion stage.
- --sign Generate a PGP or GPG signature.
- --target=
+ Set the installation platform of the generated package. - --test Only perform a test; do not actually install the package.
- --timecheck
Set the number of seconds for the check timing. - --triggeredby
Query who built the package. - --triggers Display the packaging scripts inside the package.
- --verify This parameter has the same effect as specifying the "-q" parameter.
- --version Display version information.
- --whatprovides
Query the compatibility the package provides for the specified capability. - --whatrequires
Query the compatibility the package requires for the specified capability.
Example
Install software
# rpm -hvi dejagnu-1.4.2-10.noarch.rpm
警告:dejagnu-1.4.2-10.noarch.rpm: V3 DSA 签名:NOKEY, key ID db42a60e
准备...
########################################### [100%]
Display software installation information
# rpm -qi dejagnu-1.4.2-10.noarch.rpm
【第1次更新 教程、类似命令关联】
Linux Command Reference