如何使用cabal卸载我自己构建的hackage包?

huangapple go评论63阅读模式
英文:

How to uninstall a hackage built by myself with cabal?

问题

我使用 cabal buildcabal install 安装了一个 Hackage 包来进行测试。

如何卸载它?

无法使用 uninstallremove

英文:

i use cabal build and cabal install to install a hackage for a test

executable test-hackage
    main-is:          Main.hs

    -- Modules included in this executable, other than Main.
    -- other-modules:

    -- LANGUAGE extensions used by modules in this package.
    -- other-extensions:
    build-depends:    base ^>=4.16.4.0
    hs-source-dirs:   app
    default-language: Haskell2010

how can i uninstall it?

uninstall remove can not be used

答案1

得分: 0

cabal install的默认行为是将可执行文件安装到cabal的软件包存储中,并在目标目录中创建符号链接(在Linux上默认为~/.cabal/bin)。如果您只想从路径中删除可执行文件,删除符号链接就足够了。

目前,cabal没有卸载命令。如果需要回收磁盘空间,最直接的方法是删除存储区。关于此事,用户指南中有以下内容:

全局软件包存储是~/.cabal/store(可以通过全局的store-dir选项进行配置);如果您需要出于任何原因清除存储区(例如为了回收磁盘空间或因为全局存储区损坏),删除此目录是安全的(v2-build将在下一次调用时重新构建它所需的一切)。

英文:

The default behaviour of cabal install is to install the executable to cabal's package store and create a symlink to it in the destination directory (which, in Linux, defaults to ~/.cabal/bin). If you just want to remove the executable from your path, deleting the symlink is enough.

cabal currently doesn't have a uninstall command. If there's a need to reclaim disk space, the most straightforward way to do so is deleting the store. Here is what the User's Guide has to say on the matter:

> The global package store is ~/.cabal/store (configurable via global store-dir option); if you need to clear your store for whatever reason (e.g., to reclaim disk space or because the global store is corrupted), deleting this directory is safe (v2-build will just rebuild everything it needs on its next invocation).

huangapple
  • 本文由 发表于 2023年3月9日 20:10:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/75684427.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定