Thursday, May 14, 2020

RPM Package Management



1. How to check the installed software(rpm’s) on Redhat Linux ?

Answer: rpm -qa package_name (or) rpm -qa |grep package_name*

Ex:
[root@mylinz ~]# rpm -qa yum
yum-3.2.27-14.el6.noarch
[root@mylinz ~]# rpm -qa |grep yum
yum-rhn-plugin-0.9.1-5.el6.noarch
yum-utils-1.1.26-11.el6.noarch
yum-metadata-parser-1.1.2-14.1.el6.x86_64
yum-3.2.27-14.el6.noarch
PackageKit-yum-0.5.8-13.el6.x86_64
PackageKit-yum-plugin-0.5.8-13.el6.x86_64
[root@mylinz ~]#

2. How to install  specific software package using rpm command on Redhat Linux ?

Answer: rpm –ivh package_name 

3. How to remove the software package from on Redhat  Linux ?

Answer: rpm -ev package_name

4.How to upgrade the existing Redhat package using rpm command ?

Answer: rpm -Uvh package_name

5.How to display the list of installed software package’s files ?

Answer: rpm -ql package_name 

Ex:[root@mylinz ~]# rpm -ql yum-rhn-plugin-0.9.1-5.el6.noarch
/etc/yum/pluginconf.d/rhnplugin.conf
/usr/share/doc/yum-rhn-plugin-0.9.1
/usr/share/doc/yum-rhn-plugin-0.9.1/LICENSE
/usr/share/locale/ar/LC_MESSAGES/yum-rhn-plugin.mo
/usr/share/locale/as/LC_MESSAGES/yum-rhn-plugin.mo
/usr/share/locale/bg/LC_MESSAGES/yum-rhn-plugin.mo
/usr/share/locale/bn/LC_MESSAGES/yum-rhn-plugin.mo

6. How to get the installed software information like package version and short description of package ?

Answer: rpm -qi package_name

Ex:
[root@mylinz ~]# rpm -qi yum-rhn-plugin-0.9.1-5.el6.noarch
Name        : yum-rhn-plugin               Relocations: (not relocatable)
Version     : 0.9.1                             Vendor: Red Hat, Inc.
Release     : 5.el6                         Build Date: Fri 14 May 2010 07:18:35 PM IST
Install Date: Fri 01 Jun 2012 02:41:19 AM IST      Build Host: x86-003.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: yum-rhn-plugin-0.9.1-5.el6.src.rpm
Size        : 178193                           License: GPLv2
Signature   : RSA/8, Tue 17 Aug 2010 02:05:09 AM IST, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. 
URL         : https://fedorahosted.org/spacewalk
Summary     : RHN support for yum
Description :
This yum plugin provides support for yum to access a Red Hat Network server for
software updates.
[root@mylinz ~]#

7.How to find files belongs to which rpm package ?

Answer:rpm -qf file_location  

Ex:
[root@mylinz ~]# rpm -qf /etc/yum.conf
yum-3.2.27-14.el6.noarch
[root@mylinz ~]#

8.How to display list of configuration files for specific package ?

Answer:rpm -qc package_name

Ex:
[root@mylinz ~]# rpm -qc yum
/etc/logrotate.d/yum
/etc/yum.conf
/etc/yum/version-groups.conf
[root@mylinz ~]#

9.How to display a list of recently installed software ?

Answer:rpm -qa –last

Ex:
[root@mylinz ~]# rpm -qa --last |head
lvm2-cluster-2.02.72-8.el6                    Tue 06 Aug 2013 11:56:50 AM IST
tigervnc-server-1.0.90-0.10.20100115svn3945.el6 Wed 01 May 2013 08:39:24 PM IST
oracle-xe-11.2.0-1.0                          Tue 26 Jun 2012 01:49:05 PM IST
firefox-3.6.9-2.el6                           Tue 19 Jun 2012 02:31:03 PM IST
redhat-bookmarks-6-1.el6                      Tue 19 Jun 2012 02:30:59 PM IST

10.How to get the list of dependencies for specific rpm file ?

Answer:rpm -qpR rpm_file

Ex:
[root@mylinz ~]# rpm -qpR nautilus-sendto-2.28.2-3.el6.x86_64.rpm
/bin/sh
/bin/sh
/bin/sh
GConf2
GConf2
GConf2
libORBit-2.so.0()(64bit)
libatk-1.0.so.0()(64bit)
libbonobo-2.so.0()(64bit)
libbonobo-activation.so.4()(64bit)

11.How to get the list of dependencies for specific package ?

Answer:rpm -qR package_name

Ex:
[root@mylinz ~]# rpm -qR yum
/usr/bin/python
config(yum) = 3.2.27-14.el6
pygpgme
python >= 2.4
python(abi) = 2.6
python-iniparse
python-sqlite
python-urlgrabber >= 3.9.0-8
rpm >= 0:4.4.2
rpm-python
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
yum-metadata-parser >= 1.1.0
rpmlib(PayloadIsXz) <= 5.2-1
[root@mylinz ~]#

12.How to remove the package without checking the dependencies on Redhat Linux ?

Answer:rpm -ev –nodeps package_name

No comments:

Post a Comment