How can I uninstall a Haskell package installed globally with stack tool?
stack --help
shows that uninstall command is deprecated.
uninstall DEPRECATED: This command performs no actions, and is
present for documentation only
As stack --help
says, uninstall doesn't do anything. You can read about this on the stack github where this feature was requested, but it ended up being closed without the desire to add the behavior to stack, for various reasons. So, officially, there is no way to use stack to uninstall a package.
To remove a package that stack installed, you need to manually do so. This entails using ghc-pkg unregister and then finding the location of the package on your system and removing it via another tool or simply rm
. For example,
stack install <package name>
# Now remove the package
ghc-pkg unregister <pkg-id>
cd /path/to/stack/packages # This could be something like ~/.local/bin, but is configuration dependent
rm <package name>