Skip to content

Instantly share code, notes, and snippets.

@poldz123
Last active August 20, 2018 02:41
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 poldz123/3f8e9b4f1d218e5fc011d10f9c85c145 to your computer and use it in GitHub Desktop.
Save poldz123/3f8e9b4f1d218e5fc011d10f9c85c145 to your computer and use it in GitHub Desktop.
# Adds the java repository, repo, keys and update the apt. This also append the repo urls to
# the sources file and making sure that we do not append same deb and deb source
# all over again when running the installation.
DEB="deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main"
DEB_SOURCE="deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main"
apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
grep -q -F "$DEB" /etc/apt/sources.list || echo "$DEB" >> /etc/apt/sources.list
grep -q -F "$DEB_SOURCE" /etc/apt/sources.list || echo "$DEB_SOURCE" >> /etc/apt/sources.list
apt-get update
# Install the java8 installer and make sure that we respond to the prompt
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
apt-get -y install oracle-java8-installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment