How to uninstall a Haskell package installed with stack?

空扰寡人 提交于 2019-12-20 11:18:10

问题


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

回答1:


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>


来源:https://stackoverflow.com/questions/38636436/how-to-uninstall-a-haskell-package-installed-with-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!