Shilpa Nair has just graduated in the year 2015. She went to apply for Trainee position in a National News Television located in Noida, Delhi. When she was in the last year of graduation and searching for help on her assignments she came across Tecmint. Since then she has been visiting Tecmint regularly.
All the questions and answers are rewritten based upon the memory of Shilpa Nair.
“Hi friends! I am Shilpa Nair from Delhi. I have completed my graduation very recently and was hunting for a Trainee role soon after my degree. I have developed a passion for UNIX since my early days in the collage and I was looking for a role that suits me and satisfies my soul. I was asked a lots of questions and most of them were basic questions related to RedHat Package Management.”
Here are the questions, that I was asked and their corresponding answers. I am posting only those questions that are related to RedHat GNU/Linux Package Management, as they were mainly asked.
1. How will you find if a package is installed or not? Say you have to find if ‘nano’ is installed or not, what will you do?
Answer : To find the package nano, weather installed or not, we can use rpm command with the option -q is for query and -a stands for all the installed packages.
# rpm -qa nano OR # rpm -qa | grep -i nano nano-2.3.1-10.el7.x86_64
Also the package name must be complete, an incomplete package name will return the prompt without printing anything which means that package (incomplete package name) is not installed. It can be understood easily by the example below:
We generally substitute vim command with vi. But if we find package vi/vim we will get no result on the standard output.
# vi # vim
However we can clearly see that the package is installed by firing vi/vim command. Here is culprit is incomplete file name. If we are not sure of the exact file-name we can use wildcard as:
# rpm -qa vim* vim-minimal-7.4.160-1.el7.x86_64
This way we can find information about any package, if installed or not.
2. How will you install a package XYZ using rpm?
Answer : We can install any package (*.rpm) using rpm command a shown below, here options -i (install), -v (verbose or display additional information) and -h (print hash mark during package installation).
# rpm -ivh peazip-1.11-1.el6.rf.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:peazip-1.11-1.el6.rf ################################# [100%]
If upgrading a package from earlier version -U switch should be used, option -v and -h follows to make sure we get a verbose output along with hash Mark, that makes it readable.
3. You have installed a package (say httpd) and now you want to see all the files and directories installed and created by the above package. What will you do?
Answer : We can list all the files (Linux treat everything as file including directories) installed by the package httpd using options -l (List all the files) and -q (is for query).
# rpm -ql httpd /etc/httpd /etc/httpd/conf /etc/httpd/conf.d ...
4. You are supposed to remove a package say postfix. What will you do?
Answer : First we need to know postfix was installed by what package. Find the package name that installed postfix using options -e erase/uninstall a package) and –v (verbose output).
# rpm -qa postfix* postfix-2.10.1-6.el7.x86_64
and then remove postfix as:
# rpm -ev postfix-2.10.1-6.el7.x86_64 Preparing packages... postfix-2:3.0.1-2.fc22.x86_64
5. Get detailed information about an installed package, means information like Version, Release, Install Date, Size, Summary and a brief description.
Answer : We can get detailed information about an installed package by using option -qa with rpm followed by package name.
For example to find details of package openssh, all I need to do is:
# rpm -qa openssh [[email protected] tecmint]# rpm -qi openssh Name : openssh Version : 6.8p1 Release : 5.fc22 Architecture: x86_64 Install Date: Thursday 28 May 2015 12:34:50 PM IST Group : Applications/Internet Size : 1542057 License : BSD ....
14 thoughts on “Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management”
How to roll back patches in Linux? is it possible to roll back the kernel after post-patching?
Very nice job.
About question #1, sometimes we don’t know the exact name of the package.
For that reason, I would use ‘grep‘ command. like:
Let’s say if there is a package names ‘gnaao’, ‘Nano’ or ‘nano-7.2’ we will know about it.
Thanks for sharing the tip, hope it will help other users…
This is a good job and thanks for share your experience .
Shilpa Nair Excellent job
is any one has idea about why some time use same priority in MX for example google MX record
Priority Mail Server
I think its too late If you have not yet find the answer.
By using multiple MX records with the same preference (ie 5) will provide some load balancing
wow very nice interview, this is very helpful for me..
One of the Excellent Team work ………….
@Shilpa : Perfecto Amiga :) (y)
I am also a trainee Linux geek but unable to find this kind of jobs in Delhi and NCR area, all companies hire for minimum 2 year of experience. Can. You help me to come out this situation?
Bro am from 2019 and facing the same problem now, Could you help me?
Thanks for the info.
There’s a typo in question #5. It’s qi not qa.
Thanks Shilpa for sharing . All the best.