【发布时间】:2022-01-03 18:19:04
【问题描述】:
我正在尝试在 Ubuntu 上安装 ghcup:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
使用默认选项(添加到 .bashrc,不安装 HLS,不安装 Stack)。
问题是当脚本尝试将ghcup-0.0.6.yaml.tmp 文件写入~/.ghcup/cache 目录时我收到permission denied 错误,我不知道为什么。
目录的权限为 1775 (drwxrwxr-x)。将它们升级到 1777 (drwxrwxrwt) 并重新运行 curl 命令会产生相同的错误。目录所有者是我(不是 root),我按照 ghcup 安装说明运行不带 sudo 的 curl 命令。
完整的命令输出:
Dload Upload Total Spent Left Speed
100 24.3M 100 24.3M 0 0 5782k 0 0:00:04 0:00:04 --:--:-- 5783k
[ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.6.yaml as file /home/austin/.ghcup/cache/ghcup-0.0.6.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file
Warning: /home/austin/.ghcup/cache/ghcup-0.0.6.yaml.tmp: Permission denied
0 134k 0 858 0 0 8429 0 0:00:16 --:--:-- 0:00:16 8495
curl: (23) Failure writing output to destination
[ Warn ] Could not get download info, trying cached version (this may not be recent!)
[ ... ] If this problem persists, consider switching downloader via:
[ ... ] ghcup config set downloader Wget
[ Error ] JSON decoding failed with: YAML exception:
[ ... ] Yaml file not found: /home/austin/.ghcup/cache/ghcup-0.0.6.yaml
[ ... ] Consider removing /home/austin/.ghcup/cache/ghcup-0.0.6.yaml manually.
[ ... ]
"_eghcup upgrade" failed!
希望能解释一下发生了什么以及如何解决它,这样我就可以开始学习 Haskell!提前致谢。
【问题讨论】:
标签: haskell curl permissions ghcup