Skip to content

Instantly share code, notes, and snippets.

@rubic
Created January 22, 2012 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubic/1657678 to your computer and use it in GitHub Desktop.
Save rubic/1657678 to your computer and use it in GitHub Desktop.
Portable method to install Java on Ubuntu cloud images
cloud-init: ##############################################################
#cloud-config
apt_upgrade: true
apt_sources:
- source: "ppa:sun-java-community-team/sun-java6"
user-script: #############################################################
#!/bin/sh
DISTRIB_CODENAME=`lsb_release -s --codename`
apt-get -y install openjdk-6-jre-headless
mirror=http://us.ec2.archive.ubuntu.com/ubuntu/
printf "%%s\\n%%s\\n" "deb ${mirror} $DISTRIB_CODENAME multiverse" "deb-src ${mirror} $DISTRIB_CODENAME multiverse" | tee /etc/apt/sources.list.d/multiverse.list
apt-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment