scala - WSL 上的 sbt 安装失败
问题描述
我正在尝试从此处sbt
安装适用于 Linux 的 Windows 子系统。以下是我的 bash 终端输出:
username:repo$ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
deb https://dl.bintray.com/sbt/debian /
username:repo$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
Executing: /tmp/apt-key-gpghome.NbSR0JqpKB/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.NbSR0JqpKB/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr
我已检查dirmngr
已安装。'sudo apt-get update` 给出以下输出:
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:4 https://dl.bintray.com/sbt/debian InRelease
Get:5 https://dl.bintray.com/sbt/debian Release [815 B]
Get:6 https://dl.bintray.com/sbt/debian Release.gpg [821 B]
Hit:7 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:6 https://dl.bintray.com/sbt/debian Release.gpg
Reading package lists... Done
W: GPG error: https://dl.bintray.com/sbt/debian Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 99E82A75642AC823
E: The repository 'https://dl.bintray.com/sbt/debian Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details
输出sudo apt-get install sbt
:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package sbt
我已经查看了有关安装的类似问题,crystal
但不知道如何将解决方案应用于这种情况。
解决方案
这是一个 WSL 错误,请参阅此解决方法。
您只需要更改十六进制值。因此,对于 SBT,它将是:
curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
PS:注意此命令旨在替换以下命令
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
如您所见,两个十六进制值是相同的。(除了在第一个前面添加它0x
用于指示以下是十进制值)。
因此,此解决方法可以应用于任何键。
推荐阅读
- javascript - 节点 js TCP.onStreamRead 问题
- angular - Angular,在 AppRoutingModule 加载之前加载 json 文件
- python - 有人可以分解这段代码并解释一下吗?
- angular - 使用 Web3 时浏览器中未捕获的 ReferenceError
- html - 阻止左滑动菜单使用 css 推送内容
- asp.net - Visual Studio:新安装后的智能感知问题
- html - 网格在 HTML CSS 中制作盒子?
- mongodb - MopngoDb 单节点副本集与 docker 容器
- mpandroidchart - 如何在数据中定位MPandroid图表条形图的数据标签
- string - Scala通过反引号拆分字符串