如何完整删除cabal安装的软件包? [英] How to completly remove packages installed by cabal?
问题描述
基本上,如果我在没有工作的情况下工作, sandbox
,我的工作流程是:
- 运行
cabal init
- 编辑
src / Mylib.hs
,然后编辑mylibname.cabal
- 运行
cabal build
- 运行
cabal repl
并测试我的代码
- 运行
cabal install
现在,我看到了我自己的项目:
- 安装到
〜/ .cabal / lib / x86-64-linux-ghc-7.10.1
- 注册在
〜/ .ghc / package.conf.d
我可以编写 import Mylib
在我的其他haskell源代码中,所以我认为这个包已经成功安装了。
I r ead 这篇文章,他说:
没有cabal uninstall命令。您只能使用ghc-pkg注销
包:
ghc-pkg unregister
$ c
所以我运行
ghc-pkg unregister mylibname
现在看来该软件包未注册
〜/ ghc / package.conf.d
,但是,在〜/ .cabal / lib / x86-64-linux中仍然有一个编译过的库-ghc-7.10.1
。
那么,我该如何彻底删除我的项目,我可以
rm - rf
〜/ .cabal
?解决方案您可以从packages目录中自行删除文件。然而,没有命令这样做的原因是一般不保证其他地方不可能有任何联系,因此这种删除可能会导致破坏。也就是说,还有一种工具可以用来删除你的内容,如果你确实需要的话。
http://hackage.haskell.org/package/cabal-uninstall
另外还有一个具有更多功能的工具,可以让你找出哪些软件包没有反向缩放,所以至少没有其他的软件包中断:
https://github.com/iquiw/cabal-delete p>
I am trying to learn cabal, and have tested several my own little projects, now I want to clean them up.
Basically, if I am working without a
sandbox
, my workflow is:
- run
cabal init
- edit
src/Mylib.hs
, and then editmylibname.cabal
file- run
cabal build
- run
cabal repl
and test my code- run
cabal install
Now, I see my own project:
- installed into
~/.cabal/lib/x86-64-linux-ghc-7.10.1
- registered in
~/.ghc/package.conf.d
I can write
import Mylib
in my other haskell source code, so I think the package is successfully installed.Then I want to uninstall the package, as the package itself is just meaningless experiment code.
I read this article, who says that:
There is no "cabal uninstall" command. You can only unregister packages with ghc-pkg:
ghc-pkg unregister
so I run
ghc-pkg unregister mylibname
Now, it seems that the package is unregistered in
~/ghc/package.conf.d
, however, there is still a compiled library in~/.cabal/lib/x86-64-linux-ghc-7.10.1
.So, how could I completly remove my project, could I just
rm -rf
the library in~/.cabal
?解决方案You can delete the files yourself from the packages directory. However, the reason no command to do so is provided is there's in general no guarantee something may not have linked against them elsewhere, and so such deletions may cause breakages. That said, there's also a tool that goes and does the deletion for you if you really want it.
http://hackage.haskell.org/package/cabal-uninstall
And there's a tool with a bit more functionality that also lets you figure out what packages have no reverse deps, so at least no other packages break:
https://github.com/iquiw/cabal-delete
这篇关于如何完整删除cabal安装的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!