An Introduction to Linux RPM Package Management

RPM Package Management

In Linux you can install packages through many ways like rpm, shell script, source tar balls, YUM, etc. In this article, we will cover rpm package management in detail.

Features of RPM:

  • RPM keeps the information of all the installed packages under the /var/lib/rpm database.
  • If you have installed packages using source code, then rpm won’t manage it.
  • RPM deals with .rpm files which contains the actual information about the packages such as what it is, from where it comes, dependencies info, version info, etc.

Run below command to check the signature:

# rpm --checksig packagename

How to check dependencies of an RPM package before installing?

# rpm -qpR <PackageName>

Where

-q: to query a package

-p: to list capabilities this package provides. {Query an (uninstalled) package PACKAGE_FILE}

-R: to list capabilities on which this package depends.

How to install an RPM package without dependencies?

# rpm -ivh --nodeps <PackageName>

This command will forcefully install the rpm packages by ignoring the dependencies error. If the dependency files are missing, the program will not work at all until you install the dependencies.

Some useful RPM Commands:

To query an rpm package:

# rpm -q <package>

To list all the files of an installed rpm:

# rpm -ql <package>

To check recently installed package:

# rpm -qa --last

To upgrade a package:

# rpm -Uvh <package>

To remove a package:

# rpm -ev <package>

To uninstall without dependencies:

# rpm -ev --nodeps vsftpd

To query a file to check which rpm package it belongs to:

# rpm -qf /usr/bin/passwd

To query an installed package:

# rpm -qi <package>

To check the info about a package you downloaded from internet before you install it:

# rpm -qip <package>

To query the documentation of an installed rpm package:

# rpm -qdf /usr/bin/vmstat

To verify all the rpm packages:

# rpm -Va

That’s it in this article, hope you enjoyed it. Please share it across if you think it’s good.

Leave a Reply

Your email address will not be published. Required fields are marked *