cabal-install uninstall ?

Marc Weber marco-oweber at
Tue May 6 13:08:26 EDT 2008

Hi Benedikt.

Having a ./setup install-update-remove-outdated seems to be fine..
However how should cabal know which package versions are needed by your
applications? Eg you might be working on a project requiring
xhtml-3000.0.2.1 (A) and beeing not compatible with xhtml-3001 ?
So this should only be done on major version numbers for packages using
the x.x.x.x versioning scheme.

There is another issue: 
If you have another package isntalled having been compiled with the old
xhtml package it would be fatal to remove it because that library
depends on the old version I think (not totally sure.. at least having
none breaks ..) ? Has someone tried this? All package-deps are build
time deps AFAIK (?)

If you want this behaviour you can try nix. you can install a ghc
wrapper with a set of libs. Updating a package updates all of them.
However there is a drawback: nix is a whole distribution system..
You'll get glibc etc again as well. It's my tool of choice getting rid
of all this update / when to delete what issues by using kind of garbage
collector applied to your disk store content.

Writing a tool removing all old versions isn't hard at all because all
package databases are just written using show and there is a read
instance. Using ghc-pkg list and filtering all lines ending with ':'
(cabal is doing this) should give you a list of all package databases.
Read them and check for them by yourself It looks like this. 
(packagedb :: [InstalledPackageInfo] ) <- fmap read $ myReadFile
Creating a map sorted by names without versions and then listing/
removing old duplicates should be trivial.

I've never really worked on a mac.. So maybe this all doesn't apply to

Marc Weber

More information about the cabal-devel mailing list