dc95
dc95

Reputation: 1359

sbt installation on WSL Fails

I am trying to install sbt on Windows subsystem for Linux from here. Following is my bash terminal output:

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

I have checked that dirmngr is installed. 'sudo apt-get update` gives following output:

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

Output of sudo apt-get install sbt:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package sbt

I have looked at this similar question about installing crystal but don't know how to apply the solution to this situation.

Upvotes: 2

Views: 2255

Answers (1)

It is a WSL bug, see this workaround.

You only need to change the Hexadecimal value. So for SBT it would be:

curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add

PS: Note this command is intended to replace the following command

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823

As you can see, both Hexadecimal values are the same. (Except that in the first one you prepend it with 0x which is used to indicate the following is a decimal value).
So, this workaround can be applied to any key.

Upvotes: 5

Related Questions