Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall a Haskell package installed with stack?

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
like image 509
Kwang Yul Seo Avatar asked Jul 28 '16 12:07

Kwang Yul Seo


People also ask

How do I uninstall stacks?

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.

Where is Haskell stack installed?

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.

How do I uninstall Haskell?

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

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>
like image 131
jkeuhlen Avatar answered Oct 21 '22 05:10

jkeuhlen