#!/bin/bash # install debconf sudo apt-get install debconf-utils # create answer file sudo debconf-set-selections <<\EOF sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true EOF # add repository sudo add-apt-repository -y ppa:flexiondotorg/java # downgrade to Oneiric if [ $(lsb_release -rs | tr -d ".") -ge 1204 ]; then sed -i 's|precise|oneiric|g' /etc/apt/sources.list.d/flexiondotorg-java-*.list fi # update repository sudo apt-get update -qq # install sudo apt-get install -y --force-yes sun-java6-jre sun-java6-plugin sun-java6-fonts # set as default sudo update-java-alternatives -s java-6-sun # associate Java web apps to Sun Java 6 Web Start echo "application/x-java-jnlp-file=sun-java6-javaws.desktop" >> /etc/gnome/defaults.list