2

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?

3 Answers 3

3

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'`
2

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).

1
  • On Max OS X 10.6.8, you'll get an illegal option error for -r Commented Apr 25, 2012 at 22:06
1

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/init.sh"
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  \
    /usr/X11/lib/X11/xinit/xinitrc
replacing YYMMDDhhmm with the actual extension on your system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .