This article explains how to install an RPM file on Linux OS Distribution. RPM (Red Hat Package Manager) is a package management system used in RHEL, CentOS, Fedora, Rocky Linux, and AlmaLinux. If you have an .rpm package, you can install it using RPM, YUM, or DNF.
Prerequisites:
- A Linux OS that supports RPM (RHEL-based distributions)
- Root or sudo privileges
- An .rpm package to install
Method 1: Install RPM File Using RPM Command
You can install an RPM package manually with the rpm command.
- Install an RPM package:
sudo rpm -ivh package-name.rpm
-i → Install
-v → Verbose output
-h → Shows progress with hash marks - Upgrade an existing RPM package:
sudo rpm -Uvh package-name.rpm
-U → Upgrade (installs if not present)
- Remove an RPM package:
sudo rpm -e package-name
- Check if a package is installed:
rpm -q package-name
- List all installed RPM packages:
rpm -qa
Method 2: Install RPM File Using YUM (For Dependency Resolution)
- If your system uses YUM (CentOS/RHEL 7 and earlier), use this command:
sudo yum install package-name.rpm
This method automatically resolves dependencies.
Method 3: Install RPM File Using DNF (For Modern Systems)
- For CentOS 8, RHEL 8+, Fedora, AlmaLinux, and Rocky Linux, use DNF:
sudo dnf install package-name.rpm
DNF is the preferred package manager as it handles dependencies better than YUM.
Method 4: Convert DEB Packages to RPM (If Needed)
- If you have a .deb package (used in Debian/Ubuntu) but need an RPM, you can use alien to convert it:
sudo apt install alien -y # Install Alien on Debian/Ubuntu sudo alien --to-rpm package-name.deb # Convert DEB to RPM
Hope you liked our article. If you require any help, feel free to contact our support staff.
Facing issues with RPM installation? Learn How to Install the RPM Via WHM effortlessly!