Voxfor - All rights reserved - 2013-2025
We Accepted





The rpm (Red Hat Package Manager) command is essential for managing software packages in RPM-based Linux distros like Red Hat Enterprise Linux (RHEL), Fedora, and CentOS. This guide will show you how to use the rpm command, covering syntax, standard options, and practical examples. Whether installing, querying, or verifying packages, this guide will help you navigate everything.
The rpm command is a package management tool for managing software in .rpm (RPM Package Manager) format. It allows users to handle packages such as installing, querying, updating, verifying, and removing software.
The fundamental syntax for the rpm command is:
rpm [OPTION] PACKAGE_NAME
The rpm command offers several features tailored for many software:
You can query installed packages to check for specific software, list everything installed, or verify details about a particular package. For example, to check if a specific package is installed, use
rpm -q PACKAGE_NAME
To view a complete list of all software packages installed on your system, you can use
rpm -qa
This command queries the RPM database and outputs the names of all installed packages. It’s beneficial for system audits, troubleshooting, or verifying which applications are currently installed.
To retrieve in-depth details about a specific package installed on your system, use the command
rpm -qi PACKAGE_NAME
This command provides details about the package, including its name, version, date of release, installation, size, summary, and description. It is useful when you require confirmation on the source of specific packages, enlightenment on the function of a specific package, or help when facing problems with any package.
Installing software is the primary function of the rpm package manager.
By using the command
rpm -i PACKAGE_FILE.rpm
You can easily install new software packages on your system. Theโi flag specifies installation, and you can add options likeโv for detailed feedback andโh for progress markers, making the process user-friendly and transparent. This functionality confirms that installing software is efficient and manageable, even for complex packages.
Install with progress and verbose output:
To install a software package while monitoring the progress and getting detailed feedback, use
rpm -ivh PACKAGE_FILE.rpm
Theโi flag installs the package,โv enables verbose output, andโh displays hash marks to indicate progress. This combination provides clear visibility of the installation process, helping users identify any issues and better understand what happens during the operation. It is beneficial for tracking large or critical installations.
4.3 How to Verify Packages
Verifying packages is essential to confirm if they were installed correctly and have not been altered.
Verify package integrity:
Use the command
rpm -V PACKAGE_NAME
Perform a package consistency check, which verifies all the files of the installed packages against their original state and shows missing files, changed permissions, or any other modification. Verifying the assets is also mandatory within this type of atmosphere to ensure system security and prevent adverse changes to packages and other vulnerabilities.
Removing unused or problematic packages is very simple with rpm.
Remove a package:
To uninstall a package that is no longer needed or causing issues, use
rpm -e PACKAGE_NAME
Theโe flag stands for “erase,” ensuring the specified package is removed from your system. This command helps free up disk space, resolve software conflicts, or clean up unused applications. The simple command confirms that the associated files and entries in the RPM database are correctly deleted.
When a package requires specific dependencies, rpm will alert you if they are missing. You can preemptively check dependencies.
List package dependencies:
To identify the dependencies required by a package before installation, use
rpm -qpR PACKAGE_FILE.rpm
Theโq flag queries the package,โp specifies a package file (not yet installed), and -R lists all dependencies. Missing dependencies can be annoying. Thus, this command can be very handy in that you will be prompted to install what supporting packages in advance. Before making the installation, dependencies will be resolved, and possible mistakes will be avoided.
For security-consciousness, validate a package’s authenticity using cryptographic signatures.
Check the signature of a package:
Validate the cryptographic signature of the package using
rpm --checksig PACKAGE_FILE.rpm
This process approves whether a trusted source signed the package and whether it was not altered. It protects your system from potentially malicious or modified software versions by ensuring only the exact package defined is installed, thus requiring security-conscious users to adhere.
To confirm what files a package has installed:
List files from an installed package:
To view all files installed by a specific package, use
rpm -ql PACKAGE_NAME
Theโq flag queries the package, and theโl flag lists the files. This command helps one identify how a package affects your system, track configuration or executable files, and, in general, identify problems arising from missing or misplaced files. While the file installation paths are easily viewable to users, they also help keep track of the installed software easily.
To perform a complete audit of all software installed on your system, use
rpm -qa
Theโq flag queries the RPM database, and the -a flag lists all packages. This will be of great help to system administrators who need to determine which applications are installed, debug issues, or check for compliance with organizational policies. It gives a clear list of the package names, thus helping when tracking system versions and software updates.
To install a software package while tracking its progress, use the command.
rpm -ivh example-1.0.0.rpm
Theโi flag starts the installation process, theโv flag provides more detailed information, and theโh displays progress hash marks. This approach makes it easier to track every step of the installation process and detect problems when they appear. It is used where the installation is big or crucial since visibility and errors must be identified for a seamless process.
To confirm that essential software remains intact and unaltered, use
rpm -V ModemManager
The -V flag verifies the integrity of the specified package by comparing its current state with the original installation files. Any discrepancies, such as missing files, altered permissions, or corrupted data, are flagged. This command is essential for maintaining system security and stability for sensitive software like ModemManager, where unauthorized modifications could lead to malfunctions or vulnerabilities.
To uninstall software that is no longer needed, use
rpm -e nginx
Theโe flag, short for “erase,” confirms that the specified package and associated files are removed from your system. Eliminating unused applications helps free up disk space, resolve software conflicts, or declutter your environment. Removing outdated or unnecessary packages also reduces potential security risks and improves system performance by maintaining a cleaner and more efficient setup.
Check Logs: Redirect outputs to logs for better tracking.
rpm -qa > installed-packages.log
Software management using the rpm command is more controlled in RPM-based Linux distribution systems such as Red Hat Enterprise Linux, Fedora, and Cent OS. Whether querying details of packages or defining integrity or dependency levels, rpm offers sound functionality for system management.
When used together with yum or dnf, it provides automatic solutions for dependency solving and even tricky package management. This process increases security compared with simply using logs to record outputs and downloads from reliable sources. Periodic updates keep the rpm utility reliable, making it an essential tool for Linux administrators and users as they help keep the systems more stable and organized.
Vinayak Baranwal wroteย this article.ย Use the provided link to connect with Vinayak on LinkedIn for more insightful content or collaboration opportunities.