Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

2 Answers 2

the -r problem of xargs can simply be avoided by using the backquotes:

fink purge `fink list | perl -lne '/^\s*i\s+(\S+)/ and print $1'`
share|improve this 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).

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.