The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Management of Data Mining Model Lifecycle to Support Intelligent Business Services iBot UNIX and Linux RSS News 0 05-06-2008 11:20 PM
A more intelligent SDIFF robbiegregg UNIX for Dummies Questions & Answers 1 02-07-2008 04:28 PM
BRForum - the CEP angle (2) - Intelligent Processes iBot Complex Event Processing RSS News 0 10-26-2007 02:10 PM
Intelligent Cluster Management for Solarflare Communications - DMReview.com iBot UNIX and Linux RSS News 0 07-13-2007 07:20 PM
Help Uninstalling Linux! skeet23 UNIX for Dummies Questions & Answers 4 11-24-2004 05:18 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-09-2007
_Spare_Ribs_'s Avatar
_Spare_Ribs_ _Spare_Ribs_ is offline
Registered User
  
 

Join Date: Dec 2006
Location: /dev/null
Posts: 72
more intelligent way of uninstalling a RPM

Hi all,

I'm writing an uninstaller for a bespoke piece of software that we deploy to our Linux terminals.

One of the packages we install is the JDK (Java Development Kit). Now over the years we have quite a number of different versions installed with different package names. In my uninstaller I want to give the option to uninstall this package. The obvious way, but not very intelligent is just go through a nice long if/else loop of all the different package names it could be until it finds a match. It will work but it's not very intelligent and every time the package name changes I need to update my uninstaller.

So I guess I'm looking for a clever way to query the rpm database or some other way that will give me the package name of the JDK installed so I can just pass this to the rpm -e command.

If I do "rpm -aqi | grep Name" this is provides me with a basic list of every package name installed. I could go further and add "| java" on the end but this would only return results where the word java appeared in the Name line which it doesn't in all JDK distributions. I can use the rpm -q to query if the package exists but this relies on me knowing the package name in the first place.

Anyone got any good suggestions? I'm probably missing something blindingly obvious but I've had a good look through the man page for rpm and I can't see to find anything.

Thanks for any help.

Last edited by _Spare_Ribs_; 10-09-2007 at 12:52 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0