Remove unwanted packages


 
Thread Tools Search this Thread
Operating Systems Solaris Remove unwanted packages
# 1  
Old 06-03-2009
Remove unwanted packages

I got a system which was installed with SUNWCXall cluster installed on it and i want remove unwanted software like GMNOME, Java Desktop System, Staroffice and numerous other softwares .. i want to do an automated removal of these packages where its uninstalled by itself ..from the is there any easiest way to do that ?
# 2  
Old 06-03-2009
Something like the following might do the trick:

Code:
for PKGSTR in `pkginfo | egrep "gnome|staroffice|jde"; do
  echo PKGSTR = ${PKGSTR}
  PKGNAME=`echo ${PKGSTR} | awk '{ print $1 }'`
  echo PKGNAME = ${PKGNAME}
  pkgrm -n ${PKGNAME}
done

I strongly suggest you run the above with the pkgrm line hashed out or not present and confirm the package list is what you want to remove, I am also doing this from memory as I do not have a Solaris system to hand (must get round to building one at home in VirtualBox at least!), i have assume that the pkginfo output starts with the package's name. pkgrm -n runs it in non-interactive mode, you can create and specify your own admin file to cause pkgrm to remove packages no matter what (break dependencies, etc) non-interactively, you may want to do this as it can be a real pain trying to determine the correct order to remove all the packages for a particular susb-system when you know you simply want to remove all of them! I have also taken a guess with "jde" being mentioned for the Java Desktop Environment so you may need to adjust that, you will need to be careful you do not remove Java (JRE or JDK) itself unless that is to be removed also...

Last edited by TonyFullerMalv; 06-03-2009 at 05:26 PM.. Reason: Added link for Sun Java Desktop Environment, VirtualBox, etc.
# 3  
Old 06-04-2009
"Automated" removal can be dangerous, if you are not careful.
Even in windows env, you will need to manually choose the program that you want to remove and it does continue after several confirmations right?
# 4  
Old 06-04-2009
yes i know it can be dangerous ... but i do not have time to remove the package one by one .. and secondly the solution give above will ask for user input everytime .. i was looking for some thing totally automated .. like expect provide the user input after it greps some thing and then provide desired in put yes or no :-)
# 5  
Old 06-04-2009
The first suggestion I'd make is to do a fresh install. That will prevent a lot of grief.

Now, what do you mean by "automated"? You still have to tell the shell which packages need to be removed. Stuff like Gnome, StarOffice, they are defined in clusters. Star Office is installed from SUNWCstaroffice, Gnome/JDS is SUNWCgna11* (there are 2 or three). So, you could get a list of the packages in the cluster you want to remove, and pass it to a pkgrm loop. If you have a test box somewhere, you may even try and see if pkgrm would remove the cluster (never tride it before, but now I'm curious).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove unwanted white space

Hi, I have a very big file 25GB with information present in it like $ head ind_stats update index statistics pfirm001.dbo.Office using 200 values go ... (11 Replies)
Discussion started by: sam05121988
11 Replies

2. Shell Programming and Scripting

How to remove unwanted " from string...

I have this Input File with extra double quotes in the middle. Please suggest how to handle this condition. Input File: "123985","SAW CUT CONCRETE SLAB 20"THICK",,"98.57","","EACH","N" "204312","ARMAFLEX-1 3/8 X 3"",,"2.48","","PER FOOT","N" "205745","MISTING HEAD HOLLOW CONE "C"... (3 Replies)
Discussion started by: BICC
3 Replies

3. Shell Programming and Scripting

How to remove unwanted strings?

Hi Guys, Can someone give me a hand on how I can remove unwanted strings like "<Number>" and "</Number>" and retain only the numbers from the input file below. INPUT FILE: <Number>10050000</Number> <Number>1001340001</Number> <Number>1001750002</Number> <Number>100750003</Number>... (8 Replies)
Discussion started by: pinpe
8 Replies

4. Shell Programming and Scripting

remove unwanted text using perl

Hello..I have a text file that need to remove unwanted text. This is the original file. No. Time Source Destination Protocol Info 16 0.649949 10.1.1.101 209.225.11.237 HTTP POST /scripts/cms/xcms.asp HTTP/1.1 ... (9 Replies)
Discussion started by: taxi
9 Replies

5. Shell Programming and Scripting

Remove unwanted lines

I have a .xml file, where i need some output. The xml file is like: Code: <?******?></ddddd><sssss>234</dfdffsdf><sdhjh>534</dfdfa>......... /Code I need the output like: code 234 534 . . . /code How can i do it? (5 Replies)
Discussion started by: anupdas
5 Replies

6. Emergency UNIX and Linux Support

Remove Unwanted Libraries - optimizing

We have a huge makefile composing of inclusion of libraries, objects and system libraries to generate a binary. How do we find out that which of the libraries we can remove in the most efficient way? Doing hit and trial method is a waste of time and can during the linking with some post linking... (12 Replies)
Discussion started by: uunniixx
12 Replies

7. Shell Programming and Scripting

awk - need to remove unwanted newlines on match

Context: I need to remove unwanted newlines from a data file listing books and associated data. Here is a sample listing ( line numbers included ): 1 360762| Skip-beat! 14 /| 9781421517544| nb | 2008.| Nakamura, Yoshiki.| NAKAMUR | Kyoko Mogami followed 2 her true love Sho to Tokyo to... (6 Replies)
Discussion started by: Bubnoff
6 Replies

8. UNIX for Advanced & Expert Users

How to Remove the unwanted Blank Lines

I have a file with the below data, i would like to remove the end blank lines with no data. I used the below commands but could not able to succeed, could you please shed some light. Commands Used: sed '/^$/d' input.txt > output.txt grep -v '^$' input.txt > output.txt input.txt file... (5 Replies)
Discussion started by: Ariean
5 Replies

9. Shell Programming and Scripting

Remove unwanted XML Tags

I have set of sources and the respective resolution. Please advice how to resolve the same using Unix shell scripting. Source 1: ======= <ext:ContactInfo xmlns:ext="urn:AOL.FLOWS.Extensions"> <ext:InternetEmailAddress>AOL@AOL.COM</ext:InternetEmailAddress> </ext:ContactInfo> Resoultion... (1 Reply)
Discussion started by: ambals123
1 Replies

10. Shell Programming and Scripting

Remove unwanted data?

Hi Can any one help me remove the unwanted data? I would want to remove the complete event id 4910 ( the type there is INFO), that means, I have to remove starting from 7th - 19th lines. can any one of you please help? Thanks, (24 Replies)
Discussion started by: hitmansilentass
24 Replies
Login or Register to Ask a Question