cabal可以不卸载软件包吗? [英] Can cabal not un-install packages?
问题描述
那么卸载软件包的最佳方法是什么?
%cabal update
%cabal install mighttpd2
mighttpd2安装成功。但是,ghc-pkg找不到&取消注册:
%ghc-pkg list | grep -i可能
%ghc-pkg取消注册mighttpd2
ghc-pkg:找不到包mighttpd2
真诚!
> find .cabal | grep -i mighttp
.cabal / share / doc / mighttpd2-2.3.3
.cabal / share / doc / mighttpd2-2.3.3 / LICENSE
.cabal / share / mighttpd2-2.3 .3
.cabal / share / mighttpd2-2.3.3 / sample.conf
.cabal / share / mighttpd2-2.3.3 / sample.route
.cabal / packages / hackage.haskell .org / mighttpd2
.cabal / packages / hackage.haskell.org / mighttpd2 / 2.3.3
.cabal / packages / hackage.haskell.org / mighttpd2 / 2.3.3 / mighttpd2-2.3.3 .tar.gz
> ghc-pkg列表| grep -i package \.conf
/usr/local/lib/ghc-7.0.3/package.conf.d:
/home/sw2wolf/.ghc/i386-freebsd-7.0.3 /package.conf.d:
所以.cabal / packages / hackage.haskell.org不能被ghc-pkg看到。
您可能没有Cabal路径作为GHC路径的一部分。
第1步
首先,试着找出你的GHC包路径是什么,
ghc-pkg list
#显示类似/home/username/.../package.conf.d的内容
然后,确保一个Cabal正在写信给活动。对我来说,Cabal添加软件包到
/home/username/.ghc/x86_64-linux-7.0.4/package.conf .d
第2步
如果有
strace -f -o trace.txt cabal install mighttpd2 $ b在你的系统上没有这样的目录,看看Cabal写的是什么。 $ b greppackage \.cachetrace.txt
然后将包路径添加到此系统环境变量
export GHC_PACKAGE_PATH = NEWPATH:/usr/local/lib/ghc-7.0.3/package.conf.d
再试一次,如果不行,请继续步骤3
第3步
查看该目录并查看是否有像
的文件<$ p $如果它在那里,那么你在那里,然后你就可以使用它,然后你可以使用它来创建一个新的数据库文件。可能需要recache
ghc-pkg recache --user
cabal help
shows thers isnot "uninstall" option.
then what's the best way to uninstall the packages installed by cabal ?
% cabal update
% cabal install mighttpd2
mighttpd2 is installed successfully. However the ghc-pkg cannot find & unregister it:
% ghc-pkg list | grep -i might
% ghc-pkg unregister mighttpd2
ghc-pkg: cannot find package mighttpd2
Sincerely!
>find .cabal | grep -i mighttp
.cabal/share/doc/mighttpd2-2.3.3
.cabal/share/doc/mighttpd2-2.3.3/LICENSE
.cabal/share/mighttpd2-2.3.3
.cabal/share/mighttpd2-2.3.3/sample.conf
.cabal/share/mighttpd2-2.3.3/sample.route
.cabal/packages/hackage.haskell.org/mighttpd2
.cabal/packages/hackage.haskell.org/mighttpd2/2.3.3
.cabal/packages/hackage.haskell.org/mighttpd2/2.3.3/mighttpd2-2.3.3.tar.gz
>ghc-pkg list | grep -i package\.conf
/usr/local/lib/ghc-7.0.3/package.conf.d:
/home/sw2wolf/.ghc/i386-freebsd-7.0.3/package.conf.d:
So ".cabal/packages/hackage.haskell.org" cannot be seen by ghc-pkg.
you might not have the Cabal path as part of your GHC path.
step 1
First, try to find out what your GHC package path is,
ghc-pkg list
# displays stuff like "/home/username/.../package.conf.d"
then, make sure the one Cabal is writing to is active. For me, Cabal adds packages to
/home/username/.ghc/x86_64-linux-7.0.4/package.conf.d
step 2
If there is no such directory on your system, see what Cabal's writing.
strace -f -o trace.txt cabal install mighttpd2
grep "package\.cache" trace.txt
then add the package path to this system environment variable
export GHC_PACKAGE_PATH=NEWPATH:/usr/local/lib/ghc-7.0.3/package.conf.d
try again, if it doesn't work proceed to step 3
step 3
look in that directory and see if there's a file like
mighthttpd2-version-LONGHASHCODE.conf
if it's there, then you probably need to recache
ghc-pkg recache --user
这篇关于cabal可以不卸载软件包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!