How can I uninstall a version of a Cabal package?

Norman Ramsey picture Norman Ramsey · May 14, 2012 · Viewed 39.5k times · Source

Happstack Lite is breaking on me because it's getting blaze-html version 0.5 and it wants version 0.4. Cabal says that both versions 0.4.3.4 and 0.5.0.0 are installed. I want to remove the 0.5.0.0 and use just the older version. But cabal does not have an "uninstall" command, and when I try ghc-pkg unregister --force blaze-html, ghc-pkg says my command has been ignored.

What do I do?

UPDATE: Don't believe it. Although ghc-pkg claims to ignore the command, the command isn't ignored. And with Don Stewart's accepted answer you can remove exactly the version you wish to eliminate.

Answer

Don Stewart picture Don Stewart · May 14, 2012

You can ghc-pkg unregister a specific version, like so:

$ ghc-pkg unregister --force regex-compat-0.95.1

That should be sufficient.