英文:
How to uninstall a hackage built by myself with cabal?
问题
我使用 cabal build
和 cabal install
安装了一个 Hackage 包来进行测试。
如何卸载它?
无法使用 uninstall
和 remove
。
英文:
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论