How to Install an RPM Package on Your Linux System: A Simple Step-by-Step Guide
If you’ve ever switched from Ubuntu’s Debian-based system to a Fedora, CentOS, or openSUSE machine, you might have encountered the humble yet powerful RPM package format. Installing software on these RPM-based Linux distributions often involves working with .rpm
files, and mastering this can make your life so much easier.
In this post, I’ll walk you through everything you need to know about installing RPM packages, troubleshooting common issues, and ensuring your software runs smoothly.
What is an RPM Package?
RPM stands for “Red Hat Package Manager,” but it’s now widely used across many Linux distros like Fedora, CentOS, Red Hat Enterprise Linux (RHEL), and openSUSE. An .rpm
file contains the program’s software files along with metadata about the package such as version number, dependencies, and scripts to be executed during installation.
Why Should You Learn How to Install RPMs Manually?
Sometimes software is distributed only as an .rpm
package rather than direct repos or app stores. Learning to install an RPM manually helps you:
- Quickly get a new or unsupported application running
- Install specific versions of software
- Manage dependencies when needed
- Troubleshoot installation issues
How to Install an RPM Package: Quick Steps
Step 1: Download the .rpm
File
You will first need to download the .rpm
file for your software. This might be from the official website or a trusted third-party repository.
Example:
wget https://download.example.com/software-1.2.3.rpm
Step 2: Installing with rpm
Command
The simplest way is using the rpm
command itself:
sudo rpm -i software-1.2.3.rpm
Flags explained:
-i
: install a new package-U
: upgrade or install if not already installed (useful for updates)
Example for upgrade:
sudo rpm -U software-1.2.3.rpm
Note: This method will install the package but does NOT automatically resolve dependencies!
Step 3: Installing with dnf
or yum
On Fedora and modern CentOS/RHEL systems, using package managers like dnf
(replacement for yum) is preferable since they handle dependencies automatically.
Example:
sudo dnf install ./software-1.2.3.rpm
or on older systems:
sudo yum localinstall software-1.2.3.rpm
This installs the package from the local file and downloads any missing dependencies from configured repositories.
What if You Get Dependency Errors?
If you try to install using rpm -i
without resolving dependencies first, you’ll likely get errors like:
error: Failed dependencies:
libxyz.so.1 is needed by software-1.2.3.rpm
To fix this:
- Use
dnf install ./packagename.rpm
instead ofrpm -i
- Or manually find and install missing dependency packages via your distro repositories
Bonus Tip: Querying Installed RPM Packages
Want to see if a package is already installed?
rpm -q packagename
For example,
rpm -q firefox
You can also list all installed packages:
rpm -qa | less
Removing an RPM Package
Not happy with a package or need to uninstall it?
sudo rpm -e packagename
Replace packagename
with the actual name of the installed package (not the filename).
For example,
sudo rpm -e firefox
Note that removing packages may break dependent software – always check before removing!
Recap: Your Go-To Commands for Working with RPM Packages
Task | Command Example |
---|---|
Install package | sudo rpm -i package.rpm |
Upgrade/install latest | sudo rpm -U package.rpm |
Install plus resolve deps | sudo dnf install ./package.rpm |
Query installed | rpm -q packagename |
List all installed | rpm -qa | less |
Remove/uninstall | sudo rpm -e packagename |
Final Thought
Now that you know how to install .rpm
packages on Linux systems both manually and using smarter tools like dnf
, you have more control over your system's applications. Whether you're deploying specialized apps or just experimenting with new tools outside official repos, mastering RPM installation techniques is valuable.
If you tried this out or have any questions about certain distros or tricky installations—drop a comment below! Happy installing!
Happy Linuxing!
If you'd like me to create similar posts tailored for other packaging formats like DEB or AppImage too, just let me know!