Assume I want to completely reinstall GHC/HP. I want to (as much for superstition as anything) delete anything and everything from previous installs. What do I actually need to delete (and where)?
Edit: I'm on OSX, but I'm more curious if this information is available in general, for all systems.
Edit2: So far we have:
OSX:
/Library/Frameworks/GHC.framework/
~/.cabal/
/usr/bin/ -- symlinks
I'll add to that (based on "prefix" defined here: http://www.vex.net/~trebla/haskell/sicp.xhtml#storage):
prefix/lib/
prefix/share/
prefix/bin/
prefix/share/doc/
/usr (/local) /lib/[ghc-version]
/usr (/local) /share/doc/ghc/html/libraries/ -- documentation
/usr (/local) /share/doc/ghc/
/usr (/local) /bin
/var/lib/[ghc-version]
/etc/[ghc-version]
~/.ghc/
Edit 3:
OS X:
~/Library/Haskell
Linux:
??
Windows:
??
If you've installed a Haskell Platform since about 2012 on OS X, just run
and carefully read what it outputs. You'll need to run it again with the options it offers you. Run
for more options.
Below is my original answer, which will still work, but doesn't offer as many options and is a bit "ham fisted":
Warning: This script is extreme. It will remove even your custom config files for GHC and Cabal, and executables you've built that are still in
~/Library/Haskell
or~/.cabal
. Use caution; review what it is about to do; have backups; caveat scriptor!You may want to add lines to save off and restore your config files like:
and
Bracket the
rm
lines with these. Though you may or may not want your old~/.cabal/config
if you are upgrading to newer stuff.Note that this only deals with the current user's home directory. If you have multiple user accounts that all use Haskell, then the other accounts will need cleaning as well. (Repeat the lines involving
~
.)uninstall-hs
does some of the work for you; I'm not sure how much.I am on OSX (Lion atm). I've got GHC in /Library/Frameworks/GHC.framework/ (current and previous versions). There are also some symlinks in /usr/bin, but these will be replaced by a new install.
If you have used cabal to (locally) install packages, you also may want to clean out ~/.cabal. If you have a recent cabal, you can easily reinstall all packages for the 'new' GHC version by using cabal install world and then look for directories matching previous version of GHC you had like so:
These should be safe to delete.
Hope this helps you somewhat.
Had to remove Haskell Platform on OS X recently. Most are cleaned up via Uninstaller:
These have to be cleaned up manually:
Alternatively, as documented in
there is now a custom uninstall command with options,
In general, one can document the files created by any activity (installer, ...) by bracketing the activity in a work directory with