如何完整删除cabal安装的软件包? [英] How to completly remove packages installed by cabal?

查看:256
本文介绍了如何完整删除cabal安装的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



基本上,如果我在没有工作的情况下工作, sandbox ,我的工作流程是:


  1. 运行 cabal init

  2. 编辑 src / Mylib.hs ,然后编辑 mylibname.cabal

  3. 运行 cabal build

  4. 运行 cabal repl 并测试我的代码
  5. 运行 cabal install

现在,我看到了我自己的项目:


  1. 安装到〜/ .cabal / lib / x86-64-linux-ghc-7.10.1

  2. 注册在〜/ .ghc / package.conf.d

我可以编写 import Mylib 在我的其他haskell源代码中,所以我认为这个包已经成功安装了。

然后我想卸载包,因为包本身就是只是没有意义的实验代码。

I r ead 这篇文章,他说:


没有cabal uninstall命令。您只能使用ghc-pkg注销
包:

  ghc-pkg unregister 




所以我运行

  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:

  1. run cabal init
  2. edit src/Mylib.hs, and then edit mylibname.cabal file
  3. run cabal build
  4. run cabal repl and test my code
  5. run cabal install

Now, I see my own project:

  1. installed into ~/.cabal/lib/x86-64-linux-ghc-7.10.1
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆