Working with Redhat Package Manager with examples

Working with Redhat Package Manager with examples

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.

Examples of rpm:-

1- Installing a rpm package –             rpm –ivh fuse-ntfs-3g-2013.1.13-2.el7.rf.x86_64.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

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

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

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

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

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

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

9- List all installed packages                             rpm –qa

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

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

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

13- Verify all packages                             rpm -Va

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.

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

Enjoyed this video?
"No Thanks. Please Close This Box!"