How to Install and Remove RPM Packages

This guide will teach you some, but not all, of the different ways you can install and remove RPM packages from your system.

The installation of RPM packages in Linux can be done in two ways, graphically with a package manager, for example if you are using openSUSE you can do it using YaST, for this we must go to “System” Open “YaST” and then go to the option “Install/uninstall software”.

How to Install RPM Packages

Currently, there are multiple ways you can install any rpm package, for example through the use of Zypper, yum, rpm -i, and urpm -i.

Make sure you are logged in as root or with an user with sudo privileges

Zypper

Zypper is most commontly used in openSUSE, but it can also be used in any RHEL-based system.

zypper install package_name

yum

On the other hand, if you use a distribution based on RHEL such as Fedora and/or CentOS, you can use the YUM command to install RPM packages. Simply navigate to the directory your package is located and type the following on the command line:

yum install package_name

rpm -i

There is also a universal tool for installing RPM packages (rpm -i), which is the same rpm that is present in a wide variety of distributions that use this type of package in Linux, and it is used as follows:

rpm -i package_name.rpm

urpm -i

In Linux distributions sucha s Mandriva you can use the Mandriva Control Center or RPMDrake to install RPM packages or use command urpm to install any rpm package:

urpm –i package_name.rpm

How to remove RPM packages

The most common method of removing any rpm packages is with the use of rpm with the -e flag, which is the same as --erase.

But first, we need to get the name of the package we would like to remove from our system. If you already know the package name, feel free to skip this step and move on to the next one.

We can use the yum command to get all the packages installed on our system:

yum list installed

Which then it would give us a list like this, providing us with the package name and its version.

rpm -e

rpm -e package_name

In our case we wanted to remove the Google Chrome package, so the command looked something like this:

rpm -e google-chrome-stable.x86_64
[root@linuxify ~]# sudo rpm -e google-chrome-stable.x86_64
[root@linuxify ~]# 

Summary

This guide showed you how to install any rpm package through different forms and ways. Along with how to easily remove any package you’d like with a simple and easy-to-remember command.

Leave a Comment