How to use the Linux rpm command

Linux rpm is a free program that can be used on Ubuntu to manage rpm packages, among other things. The Linux command offers numerous options to install, analyze and update packages.

What is Linux rpm?

Linux rpm is a command line tool used to manage rpm packages. These are used in particular by manufacturers of commercial software. They are not originally intended for Linux. rpm stands for “Red Hat Package Manager” and has been developed and distributed as free software by the US company Red Hat since 1997. Today Linux rpm is an independent project with a GPL license. Its main tasks are to install and uninstall software, manage configuration files and take dependencies into account.

How does the Linux rpm command work?

Before the rpm command can be used in Linux, the package management must be installed. It should not be used in addition to dpkg, since the two management systems may not work compatibly with each other. You can install rpm using the following command:

$ sudo apt-get install rpm
bash

Once installed, the program can be used with the rpm command.

What’s the syntax of the rpm command?

The basic syntax of Linux rpm looks like this:

$ rpm [Options] [Package name]
bash

In addition to the actual command, you can use the options to determine the tasks the program should perform. It’s also possible to process several packages with one command. These are simply written one after the other separated by a space character.

What are the options with rpm?

Linux rpm is suitable for analyzing, installing, uninstalling and searching packages, among other things. The command has numerous options, which you can view with the following command:

$ rpm --help
bash

The main options include:

  • -e or –erase: Delete an rpm package.
  • -i or –install: Install an rpm package.
  • -K or –checksig: Check the integrity of a package and thus uncover possible errors in advance.
  • -q or –query: Displays all available information about installed packages. It can be specified even further.
  • -U or –upgrade: Update an rpm package.
  • -V or –verify: Verify the integrity of a package, including missing or modified files.

Examples for using the rpm command

To help you better understand how the rpm command works, we’ll finish by showing you a few examples.

$ rpm -qi Paket1.rpm
bash

This displays a description of the package.

$ rpm -qa
bash

Use this command to get a listing of all installed rpm packages.

$ rpm -i Paket1.rpm Paket2.rpm
bash

Install both packages.

$ rpm -e Paket1.rpm
bash

So how do you uninstall package1.rpm? Uninstalling rpm packages you installed with Linux rpm can be done using the same program.

We use cookies on our website to provide you with the best possible user experience. By continuing to use our website or services, you agree to their use. More Information.