On Debian-based distributions, including Ubuntu, the most straightforward way is to use the .deb
installation file. Go to the Scala website. Choose the version you want to install then scroll down and look for scala-x.x.x.deb
.
You can install the scala deb from command line:
sudo dpkg -i scala-x.x.x.deb
To verify that it is installed correctly, in the terminal command prompt:
which scala
The response returned should be the equivalent to what you placed in your PATH variable. To verify that scala is working:
scala
This should start the Scala REPL, and report the version (which, in turn, should match the version you downloaded).