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
Remove a stack - Portainer Documentation. From the menu select Stacks, tick the checkbox next to the stack you want to remove, then click Remove. When the confirmation message appears, click Remove.
Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory. None of this should affect any existing Haskell tools at all.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With