ghcup-install:写入~/.ghcup/cache目录时权限被拒绝



我正试图用在Ubuntu上安装ghcup

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

使用默认选项(prepend to.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了!提前谢谢。

已解决:

结果发现snap版本的旋度是半破坏的。运行后,我成功安装了ghcup

sudo snap remove curl
sudo apt install curl

相关内容

  • 没有找到相关文章

最新更新