如何使用apt-get在ubuntu/debian上安装sbt

jav*_*dba 15 ubuntu sbt

sbt安装方向指示sbt在存储库中.然而:

$ sudo apt-get install -y sbt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package sbt
Run Code Online (Sandbox Code Playgroud)

让我们环顾四周..

$ s apt-cache search sbt
coop-computing-tools - cooperative computing tools
libnet-z3950-simpleserver-perl - simple perl API for building Z39.50 servers
libusbtc08-1 - Hardware interface library for PicoTech USB TC08 Thermocouple sensor
libusbtc08-dev - Development files for PicoTech USB TC08
python-usbtc08 - Python wrapper for libusbtc08
s51dude - In-System Programmer for 8051 MCUs using usbtiny
Run Code Online (Sandbox Code Playgroud)

嗯...... 不....

那么apt-get在ubuntu上使用sbt吗?apt repository它有特殊之处吗?

jav*_*dba 26

经过更多的搜索,答案在这里找到:http://www.scala-sbt.org/0.13/docs/Installing-sbt-on-Linux.html

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
Run Code Online (Sandbox Code Playgroud)

这个确实有效

sbt
  Getting org.scala-sbt sbt 0.13.9 ...
Run Code Online (Sandbox Code Playgroud)

然后..耐心等待..


Yuc*_*ong 18

或者,您也可以通过以下方式安装它:

curl -L -o sbt.deb http://dl.bintray.com/sbt/debian/sbt-0.13.15.deb
sudo dpkg -i sbt.deb
sudo apt-get update
sudo apt-get install sbt
Run Code Online (Sandbox Code Playgroud)

请将sbt-0.13.15上面的内容替换为sbt您想要的实际版本.

参考:

  • sbt.dev 不是 Debian 格式的存档。 (2认同)