Cabal doesn't track what it installed, it just uses the ghc library mechanism (or some other compiler if you don't use ghc), so you can use rm -r ~/.ghc to remove all locally installed libraries.
If you have multiple ghc installed and you want to remove only libs for a specific ghc, delete the subdirectory corresponding to any ghc that you want to remove.
For example, I can remove everything that I installed for ghc-7.6.0 using rm -r ~/.ghc/x86_64-linux-7.6.0.20120810
You can also use this to save your ghci_history if you want.
ll ~/.ghc/ total 24 -rw-r--r-- 1 johnl johnl 2300 Aug 21 11:47 ghci_history drwxr-xr-x 3 johnl johnl 4096 Jun 17 19:09 x86_64-linux-6.12.3 drwxr-xr-x 3 johnl johnl 4096 May 17 08:17 x86_64-linux-7.2.1 drwxr-xr-x 3 johnl johnl 4096 May 16 17:34 x86_64-linux-7.4.1 drwxr-xr-x 3 johnl johnl 4096 Jun 15 08:21 x86_64-linux-7.4.2 drwxrwxr-x 3 johnl johnl 4096 Aug 15 12:37 x86_64-linux-7.6.0.20120810
Edit: ~/.cabal/world - a list of installed packages with version restrictions specified by the user. Thus, in most cases it will include, for example, mtl -any . If you installed packages with certain versions, for example, by releasing cabal install mtl-2.1.1 , it will record this version. You must be able to either delete the world file, or start over, or if you look at it and the dependencies are acceptable, you can only try running cabal install world . Or you could ignore it, and not use support for bondage support (what I'm doing).
John L Aug 21 '12 at 4:23 2012-08-21 04:23
source share