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.
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.
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*
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).