Wednesday, August 21, 2013

RETRIVING PACKAGE INFORMATION


YUM (Yellow Updater,Modified) and rpm  (Red Hat Package Manager) are used as package managment tool. These are frequently 
used for management but comprise of less frequently  used options as follows which save the time of system administrator to 
retrieve system related information :

=> rpm can be used to find all the packages which are installed outside CentOS repositories , that is , third party repositiories as 
follows:

[root@PC1 ~]# rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v CentOS
The sample output is:
flash-plugin Adobe Systems Inc.
crash-trace-command Fujitsu Limited
adobe-release-x86_64 Adobe Systems Inc.
gpg-pubkey (none)
gpg-pubkey (none)

=> We can quickly view the documentation related to a package using either of the two commands as below:
rpm -qd <packagename>
 OR
rpm -qdf /path/to/file
The    first command gives the documentation present in  the rpm  while second option gives the documentation in the package 
which owns the file.For example:
 [root@PC1 ~]# rpm -qd pinentry-0.7.6-6.el6.x86_64
/usr/share/doc/pinentry-0.7.6/AUTHORS
/usr/share/doc/pinentry-0.7.6/COPYING
/usr/share/doc/pinentry-0.7.6/ChangeLog
/usr/share/doc/pinentry-0.7.6/NEWS
/usr/share/doc/pinentry-0.7.6/README
/usr/share/doc/pinentry-0.7.6/THANKS
/usr/share/doc/pinentry-0.7.6/TODO
/usr/share/info/pinentry.info.gz

=> The       following command is used to list the file stored inside the rpm file
# rpm -qpl file.rpm
For        example,
  [root@PC1 ~]# rpm -qpl Downloads/adobe-release-x86_64-1.0-1.noarch.rpm 
/etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
/etc/yum.repos.d/adobe-linux-x86_64.repo
=> We can also list the files in the installed package using following command:
# rpm -ql packageName
For example,
 [root@PC1 ~]#rpm -ql httpd
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/README
/etc/httpd/conf.d/welcome.conf


0 comments:

Post a Comment