echo '#! /bin/sh' > regkey.shNow browse to the link below. Click on the Technical Details about the PPA link, and use the drop down box to find the links for your version:
echo 'gpg --keyserver pgp.mit.edu --recv-keys $1' >> regkey.sh
echo 'gpg --export --armor $1 | sudo apt-key add -' >> regkey.sh
sudo chmod a+x regkey.sh
https://launchpad.net/~webupd8team/+archive/javaI'm using Ubuntu 12.04, so mine are:
deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise mainNow append them to sources.list
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' | sudo tee -a /etc/apt/sources.listDo an apt-get update:
echo 'deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' | sudo tee -a /etc/apt/sources.list
sudo apt-get updateYou should get an error message like:
W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
Grab the key from the end of the error message, and register it:
./regkey.sh C2518248EEA14886You will see a response like the one below, grab that key and register it.
gpg: directory `/home/m/.gnupg' created
gpg: new configuration file `/home/m/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/m/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/m/.gnupg/secring.gpg' created
gpg: keyring `/home/m/.gnupg/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server pgp.mit.edu
gpg: /home/m/.gnupg/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
./regkey.sh EEA14886Run the update again to make sure there are no more errors
sudo apt-get update(This is optional!) Run an upgrade
sudo apt-get upgrade -yNow you can run the Java installer:
sudo apt-get install oracle-java7-installer# when prompted, agree to the conditions, congrats! You now have Oracle Java installed!