Installing Maven 3 on Ubuntu 11.04 LTS Server

The instructions below are based on Installing Maven 3 on Ubuntu 10.04 LTS Server from Luke Bourke. I am installing Maven 3.0.3 on Ubuntu 11.04 LTS Server with Oracle Java 6.

Download the Maven 3.0.3 binary distribution from your local mirror:

$ wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/binaries/apache-maven-3.0.3-bin.tar.gz

Uncompress the binary distribution and copy it to the /usr/local directory:

$ tar -zxf apache-maven-3.0.3-bin.tar.gz
$ sudo cp -R apache-maven-3.0.3 /usr/local

Create symbolic link in /usr/bin:

$ sudo ln -s /usr/local/apache-maven-3.0.3/bin/mvn /usr/bin/mvn

Installing Sun Java 6 on Ubuntu 10.04 (Lucid Lynx)

I came across this post that almost completely explains how to get Sun Java SE 6 installed on Ubuntu 10.04 (Lucid Lynx).

$ do apt-get install python-software-properties
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

The problem I had with the original post was that add-apt-repository was not available until I installed the python-software-properties package.