Working with RPMs: Redhat Package Manager (with examples)

Last updated on March 18th, 2018 at 09:05 pm

RPM or Redhat Package Manager is the default package management utility for RHEL, Centos. Fedora. It allows us to install, remove & upgrade the rpm package files.

(Recommended Read: Creating a YUM repository from ISO & Online repo)

(Also Read: Some pretty useful YUM tips & tricks )

 

Examples of rpm:-

1- Installing a rpm package –             rpm –ivh fuse-ntfs-3g-2013.1.13-2.el7.rf.x86_64.rpm

rpm

Here, -i installs a package,

-v is for verborose (additional details of what’s being done),

-h is for showing percentage completion with # markings.

 

2- Removing a package                                                                                    rpm –evh mlocate

redhat package manager rpm

here, -e is for erasing /uninstalling a package

 

3- Upgrade a rpm package              rpm –Uvh fuse-ntfs-3g-2013.1.13-2.el7.rf.x86_64.rpm

redhat package manager rpm

Here, -U is used for upgrading the package

 

4- Checking dependencies before installing         rpm –qpR httpd-2.4.6-2-45.el7.centos.x86_64.rpm

redhat package manger rpm

Here, -q is used to query the package,

-p is used to print the capabilities of package,

& -R for printing the capabilities on which package depends

 

5- Installing rpm without dependencies        rpm –ivh –nodeps httpd-2.4.6-2-45.el7.centos.x86_64.rpm

redhat package manager rpm

 

6- Removing a package without dependencies                        rpm –evh –nodeps mlocate

redhat package manager rpm

 

7- Checking if a package is installed or not                                 rpm –q httpd

redhat package manager rpm

 

8- List all the files for a package                                                 rpm –ql httpd

redhat package manager rpm

 

9- List all installed packages                             rpm –qa

redhat package manager rpm

 

10- List info about a single package                      rpm –qi perl

redhat package manager rpm

 

11- Checking which file belongs to which package                    rpm –qf /var/log/httpd

redhat package manager rpm

 

12- Verify a package                                  rpm –Vp httpd-2.4.6-2-45.el7.centos.x86_64.rpm

redhat package manager rpm

 

13- Verify all packages                             rpm -Va

redhat package manager rpm

 

14- Checking signature of a rpm package      rpm –checksign wine-20031016-1.i386.rpm

 

These were examples of how we can use rpm command effectively. Although rpm (Redhat Package Manager) is complete package manager in itself, it has one big advantage to it i.e. dependencies for the package are to be resolved manually. Resolving dependencies can be very difficult at times, especially when dependencies have dependencies of their own & you might end up installing 10-15 packages at times (it happened, real story).

But this problem of dependency resolution has been addressed with YUM & DNF  package managements which will be discussed in separate tutorials (available soon).

This concludes our tutorial on RPM package management utility. If having any doubts/questions, please reach out & I will be happy to address them.

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.

Shusain

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

Leave a Reply