rpm

RPM Cheatsheet #

rpm is a command-line utility for managing RPM packages on RPM-based Linux distributions.

Basic Commands #

Command/OptionExampleDescription
rpm -i <package.rpm>rpm -i example-package-1.0-1.x86_64.rpmInstall a package
rpm -e <package>rpm -e example-packageUninstall a package
rpm -U <package.rpm>rpm -U example-package-1.1-1.x86_64.rpmUpgrade a package
rpm -q <package>rpm -q example-packageQuery if a package is installed
rpm -ql <package>rpm -ql example-packageList files installed by a package
rpm -qi <package>rpm -qi example-packageDisplay information about an installed package

Package Information #

Command/OptionExampleDescription
rpm -qarpm -qaList all installed packages
rpm -qf <file>rpm -qf /usr/bin/exampleFind which package a file belongs to
rpm -q --changelog <package>rpm -q --changelog example-packageShow the changelog of a package
rpm -qi <package>rpm -qi example-packageShow detailed information about a package

Package Creation and Verification #

Command/OptionExampleDescription
rpm --checksig <package.rpm>rpm --checksig example-package-1.0-1.x86_64.rpmVerify the signature of a package
rpm -K <package.rpm>rpm -K example-package-1.0-1.x86_64.rpmCheck the package integrity and signature
rpm -ba <specfile>rpm -ba example.specBuild a binary and source RPM from a spec file

Database Operations #

Command/OptionExampleDescription
rpm --rebuilddbrpm --rebuilddbRebuild the RPM database
rpm --initdbrpm --initdbInitialize the RPM database

Query Options #

Command/OptionExampleDescription
rpm -q --provides <package>rpm -q --provides example-packageList capabilities provided by a package
rpm -q --requires <package>rpm -q --requires example-packageList dependencies required by a package

Miscellaneous #

Command/OptionExampleDescription
rpm -hrpm -hPrint hash marks as the package is installed
rpm --helprpm --helpDisplay help information about rpm commands

This cheatsheet provides essential rpm commands and options for managing RPM packages on RPM-based systems.

rpm

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.