Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I uninstall a version of a Cabal package?

Tags:

haskell

ghc

cabal

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.

like image 659
Norman Ramsey Avatar asked May 14 '12 02:05

Norman Ramsey


People also ask

How to uninstall cabal?

There is no way to uninstall packages in Cabal. Currently, cabal-install doesn't know how to uninstall packages. The best you can do is to unregister the package with the GHC package-database manager, eliminating the package metadata from the database without removing the actual files.

How do I uninstall GHC?

Uninstallation. On linux, just run ghcup nuke , then make sure any ghcup added lines in your ~/. bashrc (or similar) are removed. On windows, right click on the Uninstall Haskell.


1 Answers

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

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

That should be sufficient.

like image 84
Don Stewart Avatar answered Sep 24 '22 21:09

Don Stewart