LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 07-16-2005, 11:09 AM   #1
Martin Rasch
LQ Newbie
 
Registered: Jun 2005
Location: Johnson City TN
Distribution: Suse 10.2, 10.3 Fedora Core 5 and Windows XP
Posts: 17

Rep: Reputation: 1
Wink SUSE 9.3 RPM what Software is installed a Simple way to check



I have noticed that in a lot of posts that one of the questions that keeps
coming up is what is or is not installed in RPM software.
The question of are dependencies being broken or are the development
packages or kernel sources installed.
Yes, you can check that via yast or gnome rpm manager but that assumes
that you can get there or know it exists. Secondly capture of the list for
keeping track or posting becomes a problem.
To help make the task easier I have provided a simple shell script

----Cut from here ---

#Script to Get Inventory of RPM Installed packages on Linux
#Author: Martin Rasch February 25th., 2005
#I Had a need to List What Software was available via the Console.
#Since the System Monitor is Bad can not do operations via KDE or Gnome.
#This has been like repairing via the Recovery Console on Windows 2000 or XP.
#!/bin/bash
#Clear the screen
clear
echo "Linux RPM Inventory for System at $(hostname) using $(uname -r)"
echo "This program will create a sorted file that lists what packages are installed"
echo "Please wait this may take some time ..."
#Query all packages
echo "Getting the list via RPM Manager"
rpm -qa > packages
echo "Sorting the list"
sort packages > installed

echo "Total number of Packages $(wc -l installed)" >>installed
#Add line numbers to list
echo "Adding Numbers to List"
cat -n installed >temp
mv temp installed
echo "List Created $(date)" >> installed
echo "For System $(hostname) using $(uname -r)" >> installed
echo "The Inventory is located in file installed"
echo "Done."
#normal exit
exit 0

-- Cut to here --

While in a terminal console:
The script can be created with this command
touch inventoy.sh
Cut and or paste or hand enter the material between the cut and paste
points.

Then give the script permissions correct for acting as program

chmod 711 inventory.sh

To run the script enter at prompt.

./inventory.sh

The list of installed RPM packages will be in a file installed.

if you want to use this a tracking list enter the following

mv installed installed_thisdate.txt
chmod 777 installed_thisdate.txt

You then can archive an on going list of software installed
and have the ability to check against patches or dependencies.

Hope this helps to make life easier for POSTS and general operations.

Martin
 
Old 07-17-2005, 08:41 PM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Nice and simple - well done.

other users can add a line to remove the "packages" file and maybe do things when you don't have a normal exit. But that's all just tidying up.

It may have been good to rename the title with the "A simple way to check" first - otherwise it looks like you are asking for a simple way to check ...
 
Old 07-18-2005, 01:26 PM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Quote:
Originally posted by Simon Bridge
Nice and simple - well done.
I agree with Simon Bridge, this is a nice quick utility script. Thanks for sharing Martin -- J.W.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check SW installed not by rpm maxgg Linux - Newbie 1 12-23-2004 09:29 AM
How to check if a rpm Package is already installed? DarkExile Linux - Newbie 4 12-14-2004 09:41 AM
Simple Newb Question: How do I check what version of Redhat is Installed from the CLI praefex Linux - General 1 01-27-2004 07:30 PM
How to check if such xyz.rpm is already installed? copernicus Linux - Newbie 4 10-16-2003 12:28 PM
How to check for installed software... tarballed Linux - General 3 04-02-2003 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 08:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration