rpm(8)
Query, install, update, and manage RPM package files on Red Hat-based Linux systems.
Synopsis
rpm [OPTION]... [PACKAGE_FILE]...Description
The RPM Package Manager (rpm) is used to build, install, query, and manage software packages on RPM-based distributions like Red Hat, CentOS, and Fedora. It maintains a database of installed packages and can verify package integrity.
RPM operates in several modes: query (-q), install (-i), upgrade (-U), erase (-e), and build (-b). Each mode has its own set of options. Package files are identified by .rpm extension.
Common options
| Flag | What it does |
|---|---|
-i | Install a new package |
-U | Upgrade an existing package; installs if not present |
-e | Erase (uninstall) a package |
-q | Query installed packages or package files |
-qa | List all installed packages |
-qi | Display detailed information about an installed package |
-ql | List all files in a package |
-qf | Identify which package owns a file |
-V | Verify installed packages against database |
-v | Be verbose; display extra information |
--nodeps | Ignore package dependencies |
--force | Force installation despite conflicts |
Examples
List all installed packages on the system
rpm -qaShow detailed information about the installed bash package
rpm -qi bashList all files contained in the vim package
rpm -ql vimFind which package provides the /usr/bin/python3 file
rpm -qf /usr/bin/python3Install a package from an RPM file
rpm -i package-1.0-1.el7.x86_64.rpmUpgrade an existing package to a newer version
rpm -U package-2.0-1.el7.x86_64.rpmUninstall the httpd package
rpm -e httpdVerify the bash package hasn't been modified since installation
rpm -V bash