Linux rpm command

Linux 命令大全Linux Command Reference

The Linux rpm command is used to manage packages.

rpm (full English name: redhat package manager) was originally a program specifically used by the Red Hat Linux distribution to manage various Linux packages. Because it follows the GPL rules and is powerful and convenient, it is widely popular and has gradually been adopted by other distributions. The emergence of RPM package management has made Linux easy to install and upgrade, indirectly increasing 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<build stage><package file>+ or -t <build stage><package file>+ Set the build stage for packaging the package and specify the file name of the package file.
  • -c Only list configuration files; this parameter must be used with the "-l" parameter.
  • -d Only list documentation 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.
  • -h or --hash List markers during package installation.
  • -i Display related information about the package.
  • -i<package file> or --install<package file> Install the specified package file.
  • -l Display the file list of the package.
  • -p<package file>+ Query the specified RPM package file.
  • -q Use query mode; when encountering any problems, the rpm command first asks the user.
  • -R Display the dependency information of the package.
  • -s Display file status; this parameter must be used 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 the command execution process in detail, for troubleshooting.
  • -addsign<package file>+ Add new signature authentication to the specified package.
  • --allfiles Install all files.
  • --allmatches Delete files contained in the specified matching package(s).
  • --badreloc Reconfigure the file when an error occurs.
  • --buildroot<root directory> Set the directory to be used as the root directory when building the package.
  • --changelog Display the change log of the package.
  • --checksig<package file>+ Verify the signature authentication of the package.
  • --clean After packaging is completed, delete the directories created during the packaging process.
  • --dbpath<database directory> Set the directory where the RPM database is to be stored.
  • --dump Display verification information for each file. This parameter must be used with the "-l" parameter.
  • --excludedocs When installing the package, do not install files.
  • --excludepath<exclude directory> Ignore all files in the specified directory.
  • --force Force replace packages or files.
  • --ftpproxy<host name or IP address> Specify the 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 the HTTP proxy server.
  • --httpport<communication port> Set the communication port used by the HTTP server or proxy server.
  • --ignorearch Do not verify the structural correctness of the package file.
  • --ignoreos Do not verify the structural correctness of the package file.
  • --ignoresize Do not check whether there is enough disk space before installation.
  • --includedocs When installing the package, install the files along with it.
  • --initdb Confirm that a correct database is available.
  • --justdb Update the database without changing any files.
  • --nobulid Do not execute any build stages.
  • --nodeps Do not verify the inter-dependencies of the package file.
  • --nofiles Do not verify file attributes.
  • --nogpg Skip all GPG signature authentications.
  • --nomd5 Do not use MD5 encoding calculation to verify the size and correctness of files.
  • --nopgp Skip all PGP signature authentications.
  • --noorder Do not reorder the installation order of packages in order to satisfy their dependencies.
  • --noscripts Do not execute any installation script files.
  • --notriggers Do not execute any script files inside the package.
  • --oldpackage Upgrade to an older version of the package.
  • --percent Display the percentage of completion during package installation.
  • --pipe<execution command> Create a pipe to convert the output result into input data for the execution command.
  • --prefix<destination directory> If reconfiguring the file, put the file in the specified directory.
  • --provides Query the compatibility provided by this package.
  • --queryformat<header format> Set the representation format of the header.
  • --querytags List the tags that can be used in the header format.
  • --rcfile<configuration file> Use the specified configuration file.
  • --rebulid<package file> Install the source code package and regenerate the binary package.
  • --rebuliddb Rebuild a database based on the existing database.
  • --recompile<package file> The effect of this parameter is similar to the "--rebulid" parameter, except that it does not generate a package file.
  • --relocate<original directory>=<new directory> Move files that would originally be placed in the original directory to the new directory.
  • --replacefiles Force replace files.
  • --replacepkgs Force replace packages.
  • --requires Query the compatibility required by this package.
  • --resing<package file>+ Delete the existing authentication and regenerate the signature authentication.
  • --rmsource After completing the packaging of the package, delete the source code.
  • --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 of the installation package.
  • --setperms Set file permissions.
  • --setugids Set the owner and owning group of the file.
  • --short-circuit Directly skip the steps of the specified build stage.
  • --sign Generate PGP or GPG signature authentication.
  • --target=<installation platform>+ Set the installation platform for the generated package.
  • --test Only perform a test, do not actually install the package.
  • --timecheck<check seconds> Set the countdown seconds for the check time.
  • --triggeredby<package file> Query the packager of this package.
  • --triggers Display the packaging scripts inside the package file.
  • --verify The effect of this parameter is the same as specifying the "-q" parameter.
  • --version Display version information.
  • --whatprovides<feature> Query the compatibility provided by this package for the specified feature.
  • --whatrequires<feature> Query the compatibility required by this package for the specified feature.

Examples

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 命令大全Linux Command Reference

Other extensions