Installing Scala on Debian Based Systems (e.g Ubuntu)

Having followed instructions from here, which I thought was really easy, I put together a little bash script to do exactly that. And being a sucker for the latest I went with the 2.9.0.1 installation. I am honestly not sure why Ubuntu still has 2.7.7 in its repository. Ubuntu 11.10 (oneiric)  now has scala 2.9.x so you may want to use that instead of this script but if you want to keep up to date with the latest Scala release then:

Simply copy this and paste into a file, name it whatever you want, and make it executable with chmod +x

#!/bin/bash

cd ~

echo --------------------------------------------------------------------------------------------  
echo - Getting Scala 2.9.0.1  
echo --------------------------------------------------------------------------------------------  
wget http://www.scala-lang.org/downloads/distrib/files/scala-2.9.0.1.tgz

echo --------------------------------------------------------------------------------------------  
echo - Decompressing  
echo --------------------------------------------------------------------------------------------  
tar zxf scala-2.9.0.1.tgz

echo --------------------------------------------------------------------------------------------  
echo - moving scala to /usr/share/scala  
echo --------------------------------------------------------------------------------------------  
sudo mv scala-2.9.0.1 /usr/share/scala

echo --------------------------------------------------------------------------------------------  
echo - Symlinking executables  
echo --------------------------------------------------------------------------------------------  
sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala  
sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac  
sudo ln -s /usr/share/scala/bin/fsc /usr/bin/fsc  
sudo ln -s /usr/share/scala/bin/sbaz /usr/bin/sbaz  
sudo ln -s /usr/share/scala/bin/sbaz-setup /usr/bin/sbaz-setup  
sudo ln -s /usr/share/scala/bin/scaladoc /usr/bin/scaladoc  
sudo ln -s /usr/share/scala/bin/scalap /usr/bin/scalap