What RPM packages are and how to install them

An RPM package is a file that contains software ready to install on Linux systems that use Red Hat, CentOS, Fedora, or similar distributions. The file ends in .rpm and works like a container — it holds the program files, configuration settings, and instructions for where everything should go on your system.

You install an RPM package using the command line with either the rpm command itself or the dnf package manager (which is the newer standard on most systems). The dnf method is usually simpler because it handles dependencies — other packages your software needs to run — automatically. The rpm command gives you more control but requires you to install dependencies yourself if they are missing.

The basic process takes three steps: get the RPM file onto your system, open a terminal, and run the install command. Most of the time this takes under a minute, though downloading the file itself may take longer depending on file size and your internet speed.

Key Takeaways

  • Use dnf install filename.rpm to install an RPM package if you have the file on your computer, and dnf will handle any other packages your software needs.
  • Use sudo before the command if you are not logged in as the root user, since package installation requires administrator permissions.
  • You can install directly from a web address with dnf install https://example.com/package.rpm without downloading the file first.
  • The rpm command itself works but requires you to manually install any missing dependencies, making it slower for most users.
  • Check that the file actually ends in .rpm before running the command, since installing the wrong file type will produce an error.

Installing an RPM package with dnf

The dnf command is the fastest route for most users. Open a terminal and navigate to the folder where your RPM file is located, or note the full path to the file. Then type this command, replacing package-name.rpm with your actual filename:

sudo dnf install package-name.rpm

The system will ask for your password (the one you use to log in). Type it and press Enter. The terminal will not show the characters as you type — this is normal. After you enter your password, dnf will read the package, check what other software it needs, and show you a list of everything it plans to install. Press y and Enter to confirm, and the installation will begin.

When it finishes, you will see a message saying "Complete" or similar. The software is now installed and ready to use. If you get an error saying the package was not found, double-check that the filename is spelled exactly right and that you are in the correct folder.

Installing directly from a web address

You do not need to download the RPM file to your computer first. If you have the web address of the package, you can install it directly by typing the full URL into the dnf command:

sudo dnf install https://example.com/downloads/package-name.rpm

Replace the example URL with the real address where the file is hosted. The system will download the file and install it in one step, which saves time and disk space. This works the same way as installing a local file — you will see the list of packages to install, press y to confirm, and wait for completion.

This method is useful when you are following installation instructions from a software vendor's website. Many projects provide a direct link you can paste into the terminal, and this approach is faster than downloading separately.

Using the rpm command directly

The rpm command is the older tool for managing RPM packages. It works, but it does not automatically handle dependencies, which means you may need to install other packages by hand before your software will run. Use it only if dnf is not available on your system.

The command looks like this:

sudo rpm -i package-name.rpm

The -i flag stands for "install". If you want to see more detail about what is happening, use -v (verbose) and -h (show progress) together:

sudo rpm -ivh package-name.rpm

If the installation fails because of missing dependencies, the error message will tell you which packages are needed. You will then need to install those packages separately using dnf or rpm before trying again. This back-and-forth is why dnf is the better choice for most people.

Checking if the installation worked

After installation completes, you can verify that the package is actually installed by listing all installed packages and searching for your software. Type this command:

rpm -qa | grep package-name

Replace package-name with the name of what you installed. If the package is there, you will see a line showing the package name and version number. If nothing appears, the installation did not complete successfully.

You can also try running the software itself. If it is a command-line tool, type its name in the terminal. If it is a graphical application, look for it in your applications menu or type its name in the search box. If the program starts, the installation worked.

Fixing common installation errors

The most common error is "package not found", which means the filename is wrong or you are in the wrong folder. Check the exact spelling of the filename, including capital letters and numbers. If you downloaded the file, look in your Downloads folder and verify the name matches what you typed.

Another frequent problem is "permission denied", which happens when you forget the sudo command at the start. Package installation requires administrator access, so always include sudo unless you are logged in as the root user (which is rare on desktop systems).

If you see an error about dependencies, the package needs other software installed first. Use dnf instead of rpm, since dnf will install those dependencies automatically. If you are already using dnf and still see a dependency error, the required package may not be in your system's repository, and you may need to add a new repository or install it manually.

If the installation appears to hang or freeze, wait at least five minutes before stopping it. Large packages can take time to extract and install. If it is truly stuck, press Ctrl+C to stop the process and try again.

Removing or updating an RPM package

To remove a package you no longer need, use dnf remove followed by the package name (not the filename):

sudo dnf remove package-name

To update a package to a newer version, use dnf upgrade:

sudo dnf upgrade package-name

You can also update all packages on your system at once by typing sudo dnf upgrade with no package name. This is a good practice to do regularly, as updates often include security fixes. The system will show you what will be updated and ask for confirmation before proceeding.

Frequently Asked Questions

What is the difference between dnf and rpm?

dnf is a package manager that handles dependencies automatically and works with repositories. rpm is the lower-level tool that dnf uses behind the scenes. For most users, dnf is easier because it solves dependency problems on its own. Use rpm only if dnf is not available or if you need very specific control over the installation.

Do I need to be root to install packages?

You need administrator permissions, which you get by typing sudo before the command. The system will ask for your password. If you are logged in as the root user directly, you do not need sudo, but this is uncommon on desktop systems and not recommended for security reasons.

Can I install an RPM package on Ubuntu or Debian?

No. Ubuntu and Debian use .deb packages, not RPM. RPM packages are for Red Hat-based systems like CentOS, Fedora, and RHEL. If you try to install an RPM on Ubuntu or Debian, you will get an error. Check your system type and download the correct package format.

What happens if I install a package from an untrusted source?

RPM packages can contain any code, so installing from untrusted sources is a security risk. Only install packages from official vendor websites, your system's official repository, or sources you trust. If you are unsure about a package, search online for its name and reputation before installing.

Can I install multiple RPM packages at once?

Yes. You can list multiple filenames or URLs in a single command: sudo dnf install package1.rpm package2.rpm package3.rpm. The system will install all of them and handle any shared dependencies between them.