如何卸载随堆栈安装的Haskell软件包?

Kwa*_*Seo 23 haskell haskell-stack

如何使用堆栈工具卸载全局安装的Haskell软件包?

stack --help 显示不推荐使用uninstall命令.

  uninstall                DEPRECATED: This command performs no actions, and is
                           present for documentation only
Run Code Online (Sandbox Code Playgroud)

jke*_*len 12

如上所述stack --help,卸载不会做任何事情.您可以在请求此功能的堆栈github上阅读此内容,但由于各种原因,它最终被关闭而不希望将行为添加到堆栈.所以,正式来说,没有办法使用堆栈来卸载软件包.

要删除已安装堆栈的软件包,您需要手动执行此操作.这需要使用ghc-pkg取消注册,然后在系统上找到包的位置,并通过其他工具或简单地删除它rm.例如,

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>
Run Code Online (Sandbox Code Playgroud)

  • 有时你必须做`stack exec ghc-pkg unregister ...`. (3认同)
  • 什么是 &lt;pkg-id&gt;,我如何找到它? (2认同)