How to remove a batch of packages without pulling your hair out

So, I wanted to remove all of the blastwave packages I had installed on my system. Fortunately, all of their packages start with the CSW prefix (as opposed to SUNW which Sun itself uses). A couple of lines of shell later and we have:

First create a list of installed blastwave packages

# pkginfo | grep CSW | awk '{ print $2 }' > cswpkgs.list

Now, remove them

# yes | pkgrm `cat cswpkgs.list`

Every single blastwave package will be uninstalled and what's better is you won't be prompted for each and every package to confirm that you do in fact want to remove the package.

Comments:

Just a small optimization:

# yes | pkgrm `pkginfo | grep CSW | awk '{print $2}'`

Posted by Jean-Louis Liagre on January 20, 2006 at 06:51 AM PST #

a little faster optimization :-) yes | pkgrm $(pkgrm | awk '/CSW/ { print $2}')

Posted by rodrickbrown on January 20, 2006 at 07:06 AM PST #

Post a Comment:
Comments are closed for this entry.
About

glagasse

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today