【发布时间】:2021-12-23 12:42:54
【问题描述】:
我在 WSL 中安装了 Haskell 堆栈(Windows 10 上的 Ubuntu 20.04.3 LTS)。
之后,我使用命令curl -sSL https://get.haskellstack.org/ | sh成功安装了堆栈
但是,在我尝试运行 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 标志没有帮助,因为它再次显示相同的错误。 我没能在谷歌上找到任何有用的东西。
【问题讨论】:
-
你所做的应该工作,并且在 WSL 上为我工作。您是否尝试过删除
/home/et/.stack并重新开始,以防曾经发生过一些小问题并留下损坏的目录? -
你在 WSL 1 还是 WSL 2 上?
-
感谢您提供的建议。我发现我在 WSL 1 上。
PS C:\WINDOWS\system32> wsl -l -v NAME STATE VERSION * Ubuntu-20.04 Stopped 1我会升级到版本 2 看看它是否有帮助。
标签: haskell windows-subsystem-for-linux haskell-stack