$linuxjunkies
>

rpm(8)

Query, install, update, and manage RPM package files on Red Hat-based Linux systems.

UbuntuDebianFedoraArch

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

FlagWhat it does
-iInstall a new package
-UUpgrade an existing package; installs if not present
-eErase (uninstall) a package
-qQuery installed packages or package files
-qaList all installed packages
-qiDisplay detailed information about an installed package
-qlList all files in a package
-qfIdentify which package owns a file
-VVerify installed packages against database
-vBe verbose; display extra information
--nodepsIgnore package dependencies
--forceForce installation despite conflicts

Examples

List all installed packages on the system

rpm -qa

Show detailed information about the installed bash package

rpm -qi bash

List all files contained in the vim package

rpm -ql vim

Find which package provides the /usr/bin/python3 file

rpm -qf /usr/bin/python3

Install a package from an RPM file

rpm -i package-1.0-1.el7.x86_64.rpm

Upgrade an existing package to a newer version

rpm -U package-2.0-1.el7.x86_64.rpm

Uninstall the httpd package

rpm -e httpd

Verify the bash package hasn't been modified since installation

rpm -V bash

Related commands