Novell is now a part of Micro Focus

Basics: Discover all the software included in a SUSE distro

Novell Cool Solutions: Feature
By Stomfi

Digg This - Slashdot This

Posted: 4 Oct 2005
 

MR wrote: I did a full installation of SUSE9.2 and was playing around with YaST. I noticed that many programs listed inside YaST, after installing, are not listed in the MENU. Which means that newbies like me do not even know the full capabilities of SUSE, e.g. the program ethereal is something that all must play with. Is there a way to list out the full programs that is inside SUSE9.2? Good programs should not be missed.

Answer: For SUSE

This is a good question. Depends a lot on where you are in the install process. i.e. either before you start, or afterwards.

I'm going to use my SUSE 9.3 DVD to demonstrate whilst inside SUSE 9.2. You can do this first bit with Windows and a zip utility which will read ".gz" files.

Getting the latest version of your distro is a really good idea, as this will have the latest security and performance fixes, and I think that paying the small amount they ask for SUSE is a really good way of saying thank you to SUSE and Novell for all the hard work they do in providing us with a top class OS, utilities and all those lovely applications.

Just about every distro I've played with has a file called "ls-lR.gz" on the root folder of the CD or DVD. If you've got a CD distro there may be one on each CD, although you may find one for the whole set on CD1.

If you run the command "ls -lR" in your home folder, you will get a recursive long listing of all your files. This is what is in the "ls-lR" file for the CD or DVD.

Here is Gnome looking at the file on the DVD:

And here is part of what this file contains:

You can see that I have scrolled down to where it says "packages". This is a file in the folder "/media/cdrom/SUSE/setup/descr"

Having a look inside this file gives us lots of info about each file, but really doesn't tell us what the package does. This is about as far as you can go without a linux system. If you've got two CD/DVD readers, you can use one to boot a live linux CD, and the other to look at the RPM files.

All the rest of this answer, assumes you have a linux distro running on your system.

The way of finding out what an RPM file does, is to look at the header. If you use "mc" you can look inside compressed files like RPMs by highlighting the file and pressing Enter. This is what you will see.

Highlight the HEADER file and press the F3 key or use the mouse and click "3View" in the bottom bar. Here are the contents.

This is all very well if you know what RPMs are not installed on your system.

A way to find this out and to create a shortened listing of this information is to use the "RPM" program itself. RPM has query functions that can be used to find out lots of things about the RPMs installed or not installed on your system. You can read the man page on RPM from the command line by typing "man RPM".

The RPM query function is activated by the "-q" option. You can find out if RPMs are not installed by adding the "-i" option, thus for the folder "/media/cdrom/SUSE/i586" the commands

RPM -qi /media/cdrom/suse/i586/* | grep "not installed"

will give you a list of all the RPMs not installed on your system from that particular folder.

To find out a bit more about not installed RPMs, you can add the "-p" option.

This is an example of both queries on a single file. I usually give the last options as "-qip" as it is easier for me to remember.

You can always list this information about all the RPMs in a folder by using this command so that you can use the arrow keys or the space bar to page through them.

Here is the output. You can see that I've previously given the command "cd /media/cdrom/suse/x86_64".

A lot of the information shown is not needed when we just want to know what the program does, and if it is installed or not.

Fortunately, like all the shell tools on Linux, RPM can give us exactly what we want. The Unix philosophy which Linux has adopted, is for each tool to do only one thing, but do it to the best of its ability. In this way tools can be linked together to create complex information processing tasks.

RPM has query tags for each of the information items shown above and others. You can list the tags with the command:

rpm --querytags

RPM uses these in a query with the "--queryformat" option. You can also include column sizes and newlines in the format. See the man page for further details.

This is the new RPM query. The "-i" option must not be used.


click image for larger view

The "INSTALLTIME" will be "none" if the package is not installed.

Here is the output:

RPM has lots of other options for you to explore.

To only list those packages that are not installed, you can create a list of file names from the "not installed" filter, and use these for the query with the commands:

RPMLIST=`rpm -qi /media/cdrom/suse/i586/* | grep "not installed" | cut -d" " -f2`

for RFILE in $RPMLIST

do

rpm -qp --queryformat %{NAME}"\n"%{SUMMARY}"\n\n" $RFILE

done


The three stage pipe creates the list. The for loop runs the RPM query for each file in the list.

You will have to run these commands for each folder on the CDrom.

This Newbie answer has covered:

How to find out what files are in a SUSE distro.
How to see the header file of an RPM.
How to use RPM to find packages not installed.
How to use RPM to list the summary of RPM packages.
How to list the name and summary of packages not installed.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© Micro Focus