Howdy Folks. Let’s quickly check out Installing SBT on Ubuntu, or that matter any container running on Ubuntu base image. There are multiple ways this can be done. If you want to check out installing Scala on
Ubuntu, check out this page.
1. Using Ubuntu Repositories
Well, if you using Ubuntu, it’s quite straightforward to install it using the Ubuntu repositories. Here, we are going to add a new Ubuntu package repository, instruct the Ubuntu to update the set of packages for it and then instruct to install SBT for us.
For all those, who don’t know, Ubuntu ships with a package manager which can be used to install software packages. Some of these packages are not directly shipped with the Ubuntu but are available in third-party software package repositories.
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 2EE0EA64E40A89B84B2DF73499E82A75642AC823 sudo apt-get update && sudo apt-get install sbt
2. Installing Manually using Debian Package
There is always ways to install them manually if you come across some issue for some weird reason. SBT is available as a debian package for Ubuntu and can be installed directly using the same.
dpkg -i https://dl.bintray.com/sbt/debian/sbt-1.0.0.deb
3 Installing manually using archived package
Sometimes, you might need to install a specific version of SBT which is not available in the package repositories or you came across a weird issue while doing that. In such a case, we can download the package archive from the download page and install it manually.
wget https://github.com/sbt/sbt/releases/download/v1.0.0/sbt-1.0.0.tgz sudo tar xzvf sbt-1.0.0.tgz -C /usr/share/ sudo update-alternatives --install /usr/bin/scala scala /usr/share/scala/bin/scala 9999
The above commands downloads the latest binaries, unzips them and install it in the appropriate location that is reachable from the command line.