我在 Windows 子系统 Ubuntu 20.04.3 LTS 上安装了 Haskell 的 stack。
使用命令 curl -sSL https://get.haskellstack.org/ | sh
成功安装了 stack。
但是,当我尝试运行 gchi 时,出现了以下错误:
et@DESKTOP-D0DE6C4:~$ stack ghci
Writing implicit global project config file to: /home/et/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-18.16
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-tinfo6-8.10.7.
ghc-pkg: Couldn't open database /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/package.conf.d for modification: {handle: /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/lib/ghc-8.10.7/package.conf.d/package.cache.lock}: hLock: invalid argument (Invalid argument)
make[1]: *** [ghc.mk:985: install_packages] Error 1
make: *** [Makefile:51: install] Error 2
Received ExitFailure 2 when running
Raw command: /usr/bin/make install
Run from: /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7.temp/ghc-8.10.7/
Error: Error encountered while installing GHC with
make install
run in /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7.temp/ghc-8.10.7/
The following directories may now contain files, but won't be used by stack:
- /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7.temp/
- /home/et/.stack/programs/x86_64-linux/ghc-tinfo6-8.10.7/
For more information consider rerunning with --verbose flag
Installing GHC ...
et@DESKTOP-D0DE6C4:~$
--verbose标志并没有帮助,因为它再次显示了相同的错误。 我在Google上没有找到任何有用的信息。
/home/et/.stack
并重新开始吗?以防它是一些突发情况,留下了一个损坏的目录。 - amalloy