Home / Interview Questions / Linux Interview Questions – Package Management

Linux Interview Questions – Package Management

Package management is one of the important task in Linux Administration.Red Hat Package manager aka RPM provides robust package administration on Redhat Linux.It eliminates the manually building software and made the software installation & maintenance  much easier than before. RPM has lot of front-end tools to resolve the dependencies to install any packages. In this article ,we will see about RPM package manager’s interview questions and Front end tool “yum” related interview questions. RPM&YUM are commonly used in Redhat Linux Environments. 


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

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

Yum – The RPM front-End tool – Interview Questions

1.What is yum  ?
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.

VMTURBO-CLOUD-CAPACITY

4 comments

  1. Thanks for such nice explanation.

  2. Thanks for these useful commands:)

  3. Thanks for this useful information.

  4. Its very nice article..thanks a lot..!

Leave a Reply

Your email address will not be published. Required fields are marked *