haskell - How to completly remove packages installed by cabal? -


i trying learn cabal, , have tested several own little projects, want clean them up.

basically, if working without sandbox, workflow is:

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

now, see own project:

  1. installed ~/.cabal/lib/x86-64-linux-ghc-7.10.1
  2. registered in ~/.ghc/package.conf.d

i can write import mylib in other haskell source code, think package installed.

then want uninstall package, package meaningless experiment code.

i read this article, says that:

there no "cabal uninstall" command. can unregister packages ghc-pkg:

 ghc-pkg unregister 

so run

ghc-pkg unregister mylibname  

now, seems package unregistered in ~/ghc/package.conf.d, however, there still compiled library in ~/.cabal/lib/x86-64-linux-ghc-7.10.1.

so, how completly remove project, rm -rf library in ~/.cabal?

you can delete files packages directory. however, reason no command provided there's in general no guarantee may not have linked against them elsewhere, , such deletions may cause breakages. said, there's tool goes , deletion if really want it.

http://hackage.haskell.org/package/cabal-uninstall

and there's tool bit more functionality lets figure out packages have no reverse deps, @ least no other packages break:

https://github.com/iquiw/cabal-delete


Comments