尝试使用命令安装zlib软件包时使用命令:
cabal install --root-cmd=sudo --global zlib
安装失败并显示消息:
In-place registering zlib-0.5.4.1...
cabal: Error: some packages failed to install:
zlib-0.5.4.1 failed during the final install step. The exception was:
user error (Unable to find cabal executable at: /home/manu2/.cabal/bin/cabal)
显然,manu2不是我的电脑名。帮助
Coputer使用Chakra GNU / Linux 64位intel i7-230 CPU
答案 0 :(得分:0)
因此,当您使用root-cmd进行安装时,它会调用following路径:
reexec cmd = do
-- look for our own executable file and re-exec ourselves using a helper
-- program like sudo to elevate privileges:
self <- getExecutablePath
weExist <- doesFileExist self
if weExist
then inDir workingDir $
rawSystemExit verbosity cmd
[self, "install", "--only"
,"--verbose=" ++ showForCabal verbosity]
else die $ "Unable to find cabal executable at: " ++ self
因此,可执行路径以某种方式解析为/home/manu2/.cabal/bin/cabal
,但随后在该路径上调用doesFileExist
失败。为什么会出现这种情况显然是系统依赖的,但只需尝试相关代码的片段就可以进一步调查......