Skip to content

Instantly share code, notes, and snippets.

@igniteflow
Last active January 3, 2016 08:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save igniteflow/8434859 to your computer and use it in GitHub Desktop.
Save igniteflow/8434859 to your computer and use it in GitHub Desktop.
Install Oracle Java 7 on Ubuntu in a script i.e. no confirmation
#!/bin/bash
# Install Oracle Java 7 on Ubuntu in a script i.e. no confirmation
sudo add-apt-repository ppa:webupd8team/java -y
sudo echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
sudo echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
sudo apt-get install oracle-java7-installer
sudo update-java-alternatives -s java-7-oracle
java -version
@aseigneurin
Copy link

I think you need to run "apt-get update" once you have added a repository.

@aseigneurin
Copy link

Also, you need the "-y" option on the "apt-get install".

@cirosantilli
Copy link

sudo echo | does not work, you must do echo | sudo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment