Monday, February 24, 2014

Information related rpm



  Install : It is used to install any RPM package.
  Remove : It is used to erase, remove or un-install any RPM package.
  Upgrade : It is used to update the existing RPM package.
  Verify : It is used to query about different RPM packages.
  Query : It is used for the verification of any RPM package

1. How to Check an RPM Signature Package

Always check the PGP signature of packages before installing them on your Linux systems and make sure its integrity and origin is OK. Use the following command with checksig (check signature) option to check the signature of a package called pidgin.
[root@arun]# rpm --checksig pidgin-2.7.9-5.el6.2.i686.rpm
 
pidgin-2.7.9-5.el6.2.i686.rpm: rsa sha1 (md5) pgp md5 OK

RPM command and options
  1. -i : install a package
  2. -v : verbose for a nicer display
  3. -h: print hash marks as the package archive is unpacked.

3. How to check dependencies of RPM Package before Installing

Let’s say you would like to do a dependency check before installing or upgrading a package. For example, use the following command to check the dependencies of BitTorrent-5.2.2-1-Python2.4.noarch.rpm package. It will display the list of dependencies of package.
[root@arun]# rpm -qpR BitTorrent-5.2.2-1-Python2.4.noarch.rpm

RPM command and options
  1. -q : Query a package
  2. -p : List capabilities this package provides.
  3. -R: List capabilities on which this package depends..

4. How to Install a RPM Package Without Dependencies

If you know that all needed packages are already installed and RPM is just being stupid, you can ignore those dependencies by using the option nodeps (no dependencies check) before installing the package.
[root@arun]# rpm -ivh --nodeps BitTorrent-5.2.2-1-Python2.4.noarch.rpm
 

7. How to List Recently Installed RPM Packages

Use the following rpm command with -qa (query all) option, will list all the recently installed rpm packages.
[root@arun]# rpm -qa --last
 

10. How to Remove a RPM Package

To un-install an RPM package, for example we use the package name nx, not the original package name nx-3.5.0-2.el6.centos.i686.rpm. The -e (erase) option is used to remove package.
[root@arun]# rpm -evv nx

11. How to Remove an RPM Package Without Dependencies

The nodeps (Do not check dependencies) option forcefully remove the rpm package from the system. But keep in mind removing particular package may break other working applications.
[root@arun]# rpm -ev --nodeps vsftpd

12. How to Query a file that belongs which RPM Package

Let’s say, you have list of files and you would like to find out which package belongs to these files. For example, the following command with -qf (query file) option will show you a file /usr/bin/htpasswd is own by package httpd-tools-2.2.15-15.el6.centos.1.i686.
[root@arun]# rpm -qf /usr/bin/htpasswd
 

20. How To rebuild Corrupted RPM Database

Sometimes rpm database gets corrupted and stops all the functionality of rpm and other applications on the system. So, at the time we need to rebuild the rpm database and restore it with the help of following command.
[root@arun]# cd /var/lib
[root@arun]# rm __db*
[root@arun]# rpm --rebuilddb
[root@arun]# rpmdb_verify Packages

0 comments:

Post a Comment