This post provides a quick reference guide for common RPM (Red Hat Package Manager) commands used in Linux systems.
Basic Package Operations
List installed packages:
| |
Install a package:
| |
Test installation (without actually installing):
| |
Remove a package:
| |
Upgrade a package:
| |
Freshen a package (upgrade only if previous version exists):
| |
Query and Information Commands
Query a package:
| |
Display package information:
| |
List files in a package:
| |
Find which package a file belongs to:
| |
Display file list and package information:
| |
Package Verification
Check RPM signature:
| |
Operation Reference Table
| Operation | Short Option | Long Option |
|---|---|---|
| Upgrade/install | -U | –upgrade |
| Install | -I | –install |
| Remove | -e | –erase |
| Query | -q | –query |
| Verify | -V | –verify |
| Check signature | -K | –checksig |
| Freshen | -F | –freshen |
| Initialize database | — | –initdb |
| Rebuild database | — | –rebuilddb |
Source: Fedora RPM Guide