RPM Package Management – Interview Questions
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
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 ~]#
Ex:
[root@mylinz ~]# rpm -qf /etc/yum.conf
yum-3.2.27-14.el6.noarch
[root@mylinz ~]#
Ex:
[root@mylinz ~]# rpm -qc yum
/etc/logrotate.d/yum
/etc/yum.conf
/etc/yum/version-groups.conf
[root@mylinz ~]#
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
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)
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 ~]#
Answer:rpm -ev –nodeps package_name
Yum – The RPM front-End tool – Interview Questions
Answer: yum is yellow update manager which is a front end tool for package management.
All the rpm commands activity can be carried out using yum command in automated way.
Yum mechanism will automatically resolve the dependencies unlike rpm commands.
2.How to install packages using yum ?
Answer:yum install package_name
3.How to configure yum repository in Redhat Linux ?
Answer:Here is the step by step guide
4.How to update the package using yum ?
Answer:yum update package_ name
5.How to search the package in yum ?
Answer:yum search package_name
6.How to remove the package using yum ?
Answer:yum remove package_name
7.How to check the updates for yum repository ?
Answer:yum check-update
8.How to update the yum repo ?
Answer:yum update
9.How to get the package information using yum ?
Answer:yum info package_name
10.How to list the installed packages on Redhat linux using yum command ?
Answer:yum list installed
11.How to know the particular files belongs to which package ?
Answer:yum provides file_path
Ex:
[root@mylinz ~]# yum provides /etc/yum.conf
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
yum-3.2.27-14.el6.noarch : RPM installer/updater
Repo : local-installation
Matched from:
Filename : /etc/yum.conf
yum-3.2.27-14.el6.noarch : RPM installer/updater
Repo : installed
Matched from:
Other : Provides-match: /etc/yum.conf
12.How to list the enabled repositories ?
Answer:yum repolist
Thank you for visiting UnixArena. Hope this article provides enough information about Redhat package management in interview point of view.
harikrishna cheruku says
Thanks for this useful information
Ismail Shareef says
Thanks for sharing 😎
vasanth says
Yes maximum cover rpm and yum Questions for interview point of view,Nice article
Dayanand says
Its very nice article..thanks a lot..!
Deepak Kumar says
Thanks for this useful information.
Sonal awasthi says
Thanks for these useful commands:)
Sachin Arote says
Thanks for such nice explanation.