Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Jul 1 '11 at 6:34

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

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

From the fink FAQ:

Q5.6: How can I uninstall all of Fink?

A: Almost all files installed by Fink are in /sw (or wherever
you chose to install it), except for a few exceptions.
Thus, in order to get rid of Fink, enter this command:

    fink remove --recursive daemonic xinitrc
    sudo rm -rf /sw

If you aren't planning to reinstall Fink you also will
want to remove the "source /sw/bin/init.csh" line you
added to your .cshrc file or the "source /sw/bin/"
line you added to your .bashrc file, whichever is appropriate
to your setup, using a text editor. If you had the xinitrc
package installed, then you will want to restore the original
/usr/X11/lib/X11/xinit/xinitrc, which has been backed up as
/usr/X11/lib/X11/xinit/xinitrc.YYYYMMDDhhmm, i.e. the
extension has a year, month, date, hour, and minute). If you
have more than one of these, the original one normally does
not mention sys-xinitrc-fink. Once you've found the right one,
you can use

sudo mv /usr/X11/lib/X11/xinit/xinitrc.YYYYMMDDhhmm  \
replacing YYMMDDhhmm with the actual extension on your system.
share|improve this answer

Your Answer


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.