LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script to check all the libs/rps installed (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-check-all-the-libs-rps-installed-4175461241/)

xombboxer 05-09-2013 01:01 AM

script to check all the libs/rps installed
 
We have build machines with RHEL and all of them should have extra libs installed on it. When a new machine is added, I need to check whether all the required libs installed or not. For this I need to write a script. Can anyone suggest me the best way.

I thought of writing a rpm package with all there libs as dependency. I think this needs lo of effort.

Post name edit : script to check all the libs/rpm installed

sysmicuser 05-09-2013 01:34 AM

@xombboxer

Do you have a list of rpm's/lib packages list from your current RHEL server?

I think it should not be that challenging, I am not guru but my line of thinking is produce a list on source server and then compare it with "target" server.

Say rpm packages.

Code:

rpm -qa|sort
Output produced by this one should be saved, perhaps if you want, you can lock it by chmod and then read then on target server and report anything which is missing?

Please let me know if you want code for redirection and reading.

Thank you.

xombboxer 05-09-2013 02:13 AM

Yes,I have the list of libs

@sysmicuser, Idea is good but it will list all the RPMs, the list will be big. I don't want the default RPMs. I have some 20 libs those needs to be installed in addition to the default ones and I need to deal with 20 libs. I am thinking reading all the 20 libs from a text file and then check each one in a for loop

unSpawn 05-09-2013 03:13 AM

No need to loop over it if you use 'rpm -qa' with your file and 'fgrep'.

knudfl 05-09-2013 04:28 AM

If you know when the extra packages were added, the --last option may help.
Will output a list with install date / time :

$ rpm -qa --last > last-packages.txt


-

Habitual 05-09-2013 06:56 AM

Quote:

Originally Posted by xombboxer (Post 4947640)
I need to check whether all the required libs installed or not. For this I need to write a script. Can anyone suggest me the best way.

Learn Linux, 101: RPM and YUM package management


All times are GMT -5. The time now is 01:28 AM.