使用 ghcup 安装 GHC 时如何修复此错误?

问题描述 投票:0回答:4

我正在尝试在运行 Ubuntu 子系统的 Windows 笔记本电脑上使用 ghcup 安装 GHC。我不断收到同样的错误,我什至不知道出了什么问题。以下是错误消息:

[ Info  ] verifying digest of: ghc-8.10.7-x86_64-fedora27-linux.tar.xz
[ Info  ] Unpacking: ghc-8.10.7-x86_64-fedora27-linux.tar.xz to /tmp/ghcup-61d1fb5776edc19e
[ Info  ] Installing GHC (this may take a while)
[ ghc-make ] # on Win64, "install -s" calls a strip that doesn't understand 64bit binaries.
[ ghc-make ] # For some reason, this means the DLLs end up non-executable, which means
[ ghc-make ] "utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" copy compiler stage2 "strip" '' '/home/levi...
i...         Installing library in /home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/ghc-8.10.7
i...         "/home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc-pkg" --force --global-package-db "/home/levi/.gh...
[ ghc-make ] ghc-pkg: Couldn't open database /home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d for modific...
i...         make[1]: *** [ghc.mk:985: install_packages] Error 1
             make: *** [Makefile:51: install] Error 2
[ Error ] BuildFailed failed in dir "/tmp/ghcup-61d1fb5776edc19e": Process "make" with arguments ["install"] failed with exit code 2.
[ ...   ]     Check the logs at /home/levi/.ghcup/logs and the build directory /tmp/ghcup-61d1fb5776edc19e for more clues.
[ ...   ]     Make sure to clean up /tmp/ghcup-61d1fb5776edc19e afterwards.
"_eghcup --cache install ghc recommended" failed!
levi@LAPTOP-BBDADJ2R:~$

关于为什么会发生这种情况以及如何解决它有什么想法吗?

haskell ghc ghcup
4个回答
4
投票

从 ghcup repo 上的这个问题来看(它引用了与您相同的错误),您正在使用 WSL 1,它不受支持。您必须升级到 WSL 2。


3
投票
$ sudo apt-get update -y && sudo apt-get install build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 -y

0
投票
  1. 打开您的主页 -> 在 rifgt 侧面菜单上选择“显示隐藏文件”
  2. 您将能够看到.ghcup文件夹
  3. 打开.ghcup->缓存
  4. 创建一个名为 ghcup-0.0.7.yaml 的文件
  5. 粘贴 全局工具: 希姆根: dlUri:https://downloads.haskell.org/~ghcup/shimgen/shim-2.exe dl哈希:7c55e201f71860c5babea886007c8fa44b861abf50d1c07e5677eb0bda387a70 工具要求: 全球碳氢化合物: 未知版本: Linux_Debian: 未知版本控制: 发行版 PKG: - 构建必备 - 卷曲 -libffi-dev -libffi6 -libgmp-dev -libgmp10 - libncurses-dev -libncurses5 -libtinfo5 注释: '' >= 11": 发行版 PKG: - 构建必备 - 卷曲 -libffi-dev -libffi7 -libgmp-dev -libgmp10 - libncurses-dev -libncurses5 -libtinfo5 注释:''

0
投票

在你的终端上写下:

sudo apt-get install gcc
© www.soinside.com 2019 - 2024. All rights reserved.