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.
There is also the cabal-uninstall package which provides a
cabal-uninstall
command. It unregisters the package and deletes the folder. It is worth mentioning though that it passes--force
toghc-pkg unregister
so it can break other packages.If you are outside a sandbox:
If you are inside a cabal sandbox:
The first
--
is the argument separator forhc-pkg
. This runsghc-pkg
in a sandbox aware manner.You can
ghc-pkg unregister
a specific version, like so:That should be sufficient.
Here's a shell script I use to uninstall a package. It supports multiple installed versions of GHC and also wipes relevant files (but is provided without warranty, don't blame me if you hose your installation!)