I switched to HomeBrew from Fink, and I want to uninstall Fink and all of the packages I installed with it to avoid problems in the future.

I found this perl snippet that should remove all pacages, but it doesn't: fink list | perl -lne '/^s*is+(S+)/ and print $1' | xargs fink purge

How can I remove all of the packages?

link|improve this question
feedback

migrated from stackoverflow.com Jul 1 '11 at 6:34

This question came from our site for professional and enthusiast programmers.

1 Answer

I'm not familiar with fink, but I'm assuming that fink list puts out a line for each package and for those installed they're of the format: i packagename. The problem is that you're using s and S (the literal characters) instead of \s and \S: whitespace and non-whitespace, respectively.

The correct line is probably:

fink list | perl -lne '/^\s*i\s+(\S+)/ and print $1' | xargs -r fink purge

I also added a -r to xargs so that fink purge won't run if there aren't any matching lines (installed packages).

link|improve this answer
On Max OS X 10.6.8, you'll get an illegal option error for -r – perimosocordiae Apr 25 at 22:06
feedback

Your Answer

 
or
required, but never shown