About installing Scala 2.11.4?

Solution 1:

The easiest way to install Scala would be to use the .deb installation file. On the download page you can see the newest stable version. Then go to the All Downloads page and find that version (or Scala 2.11.4). Scroll down to the bottom of that version's page and look for scala-2.11.4.deb (or the appropriate version) and download it.

If you're comfortable with the command line, you can install the downloaded Scala deb with:

sudo dpkg -i scala-2.11.4.deb

Otherwise, you're going to have to install GDebi through either the Ubuntu Software Center, or via a terminal with:

sudo apt-get install gdebi

Once GDebi is installed, you can double click scala-2.11.4.deb in your file browser which will open the package installer. Finally, click "Install Package", and your new version of Scala will be installed.

Solution 2:

Just download scala.deb and install it:

sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
sudo dpkg -i scala-2.11.6.deb
sudo apt-get update

Solution 3:

Installing scala 2.11.4 or any other version that is not in the Ubuntu repository or a PPA (mind though: scala will require JAVA and I assume you have this installed already. See the ubuntu help if you have not).

  • download the file.
  • Extract the contents to somewhere on your system. I would opt for /opt/scala/. Something like:

    tar xvfz ~/Downloads/scala-2.11.4.tgz /opt/ mv /opt/scala-2.11.4/ /opt/scala/

  • The readme in "docs" state you can run scala from the bin directory:

Installation

Decompress the archive and run the above commands directly from bin directory. We recommend adding the full path of the bin directory to the PATH environment variable.

  • ... where you have the following tools:

    - scala       Scala interactive interpreter
    - scalac      Scala compiler
    - fsc         Scala resident compiler
    - scaladoc    Scala API documentation generator
    - scalap      Scala classfile decoder
    

    So you would do

    cd /opt/scala
    scala
    

    to open the interpreter.


  • Regarding the PATH mentioned in the read me:

    Add Scala to your $PATH by adding this line to .profile inside your home directory

    PATH="$PATH:/opt/scala/bin"
    

    Mind that the path name needs to be named after what you extracted it too. Adding it would stop the need to do cd /opt/scala/ and you can envoke scala from anywhere on your system.