简体   繁体   中英

cabal zlib installation fails

While trying to install the zlib package with cabal, using the command:

cabal install --root-cmd=sudo --global zlib

the installation fails with message:

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)

Obviously, manu2 is not my computer name . Help?

Coputer uses Chakra GNU/Linux 64 bit intel i7-230 CPU

So when you install using root-cmd it invokes the following path:

   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

So somehow the executable path resolves to /home/manu2/.cabal/bin/cabal but then calling doesFileExist on that path fails. Why that might be the case is clearly system-dependent, but can be investigated further by just trying out fragments of related code...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM