What an RPM file is and why you might need one
An RPM file is a package — a single file that contains a program, a library, or a tool, along with instructions for where to put it on your computer. RPM stands for Red Hat Package Manager. It was created by Red Hat (now owned by IBM) and is used by Linux systems that descend from Red Hat's work: Fedora, CentOS, Rocky Linux, AlmaLinux, and others. If you use Ubuntu or Debian, you use a different package format called DEB instead.
You might encounter an RPM file when you read software directly from a vendor's website, or when you find a tool in a repository — a collection of packages maintained by your Linux distribution or by a third party. Installing from an RPM is usually faster and safer than downloading and running a script, because the package manager checks the file's integrity and keeps track of what was installed.
The key difference between installing an RPM and installing from source code is that an RPM is already compiled — ready to run on your system. You do not have to build it yourself.
Key Takeaways
- RPM files work on Red Hat-based systems like Fedora, CentOS, and Rocky Linux, but not on Ubuntu or Debian.
- The simplest way to install an RPM is to use the command sudo dnf install filename.rpm or sudo yum install filename.rpm, depending on which tool your system has.
- If the RPM depends on other packages that are not installed, the package manager will tell you what is missing and may offer to install them automatically.
- You can also install an RPM by right-clicking it in your file manager and selecting an option like "Open With" or "Install", if your desktop environment supports it.
- Always verify that an RPM comes from a trusted source before installing it, because a malicious RPM can run code with root privileges.
Check that your system uses RPM packages
Before you try to install an RPM, confirm that your Linux distribution actually uses RPM files. Open a terminal and run this command:
cat /etc/os-release
Look for a line that says ID= or ID_LIKE=. If it says fedora, rhel, centos, rocky, or alma, you are on an RPM-based system. If it says ubuntu or debian, RPM files will not work on your system — you need DEB files instead.
If you are unsure which package manager your system has, you can also try running dnf --version or yum --version. If either command returns a version number instead of "command not found", you have the right tool.
Install an RPM using the command line
The command line is the most reliable way to install an RPM. Open a terminal and navigate to the folder where your RPM file is located. Then run one of these commands, depending on which package manager your system has:
For systems with dnf (newer Fedora, CentOS 8 and later, Rocky Linux, AlmaLinux):
sudo dnf install filename.rpm
For systems with yum (older CentOS, RHEL versions before 8):
sudo yum install filename.rpm
Replace filename.rpm with the actual name of your file. The sudo command runs the installation with root privileges, which is required to install system-wide packages. You will be asked for your password.
The package manager will check whether the RPM depends on other packages that are not yet installed. If it does, it will list those dependencies and ask whether you want to install them too. Type y and press Enter to proceed, or n to cancel.
What to do if dependencies are missing
A dependency is another package that the RPM needs in order to work. If you try to install an RPM and the package manager says something like "requires libfoo.so.1", it means the RPM depends on a library called libfoo that is not currently installed.
In most cases, the package manager will offer to install the missing dependencies for you. If you see a prompt that says "Install these packages?", answer yes and let it proceed. The package manager will read and install everything in the correct order.
If the package manager cannot find a dependency in your configured repositories, it will tell you which package is missing. You may need to add a new repository to your system, or you may need to install the dependency manually from a different source. Check the software vendor's documentation for guidance on which repositories to enable.
Install an RPM through the file manager
If you prefer not to use the terminal, you can install an RPM by opening your file manager and navigating to the folder where the RPM is stored. Right-click the file and look for an option like "Open With", "Install", or "Install Package". The exact wording depends on your desktop environment (GNOME, KDE, Cinnamon, etc.).
Clicking this option will open a graphical package manager, usually called GNOME Software, Discover, or something similar. The process will show you the package name, version, and any dependencies. Click the install button and enter your password when prompted.
This method is simpler if you are not comfortable with the terminal, but it gives you less control and less feedback about what is happening. If something goes wrong, the error messages are often less detailed than what you would see on the command line.
Verify the RPM before installation
Before you install any RPM, especially one downloaded from the internet, check that it comes from a trusted source. Malicious RPM files can run code with root privileges, giving an attacker complete control over your system.
If the vendor provides a checksum or a digital signature, use it to verify the file. For a checksum, read the checksum file from the vendor's website, then run:
sha256sum -c checksum-file.txt
If the output says "OK", the file has not been tampered with. If the vendor provides a GPG signature, you can verify it with:
rpm --checksig filename.rpm
This command will tell you whether the signature is valid and who signed it. If you do not recognize the signer, or if the signature is invalid, do not install the RPM.
Troubleshoot common installation problems
If you see an error like "No such file or directory", make sure you are in the correct folder and that you typed the filename correctly. Use ls to list the files in your current directory and confirm the RPM is there.
If you see "command not found" when you try to run dnf or yum, your system may not have a package manager installed, or you may be on a non-RPM system. Run cat /etc/os-release again to confirm your distribution.
If the installation fails with a message about conflicts — for example, "file /usr/bin/sometool conflicts with package othertool" — it means another package is trying to install a file with the same name. You may need to uninstall the conflicting package first, or choose a different version of the RPM.
If you see a message about architecture mismatch, such as "requires libfoo.so.1()(64bit)", it means the RPM is built for a different processor type than your system. Check whether your system is 32-bit or 64-bit by running uname -m, and read the RPM that matches.
Frequently Asked Questions
Can I install an RPM on Ubuntu or Debian?
No. RPM files are designed for Red Hat-based systems. Ubuntu and Debian use DEB files instead. If you try to install an RPM on Ubuntu, the package manager will refuse. You need to find a DEB version of the software, or build it from source code.
What is the difference between dnf and yum?
Both are package managers for RPM-based systems. dnf is newer and faster; it replaced yum in Fedora 22 and CentOS 8. If your system has dnf, use that. If it only has yum, use that instead. The commands are almost identical.
Do I need root access to install an RPM?
Yes. Installing system-wide packages requires root privileges, which is why you use sudo. If you do not have sudo access on your system, ask your system administrator to install the RPM for you.
What happens if I install an RPM from an untrusted source?
A malicious RPM can run code with root privileges during installation, giving an attacker complete control over your system. Always verify the source and check the checksum or signature before installing anything.
Can I uninstall an RPM after I install it?
Yes. Use sudo dnf remove packagename or sudo yum remove packagename, where packagename is the name of the package (not the filename). You can find the package name by running rpm -qa | grep keyword to search for it.