3

I used the following code to install openjdk 7 and to add repository,

sudo apt-get install openjdk-7-jdk
sudo apt-add-repository ppa:webupd8team/java

Then I have updated the packages using sudo apt-get update, After this when I try to install Java using the following command,

sudo apt-get install oracle-java8-installer

I am getting error, the error code response is,

2016-04-20 13:00:45 (442 MB/s) - ‘jdk-8u77-linux-i586.tar.gz’ saved [5165]
Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-8u77-linux-i586.tar.gz
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

How to debug and resolve this, I am new to Ubuntu. Thanks.

  • Later when I install chromium browser I am getting the following error,

    Removing outdated cached downloads... sha256sum mismatch jdk-8u77-linux-i586.tar.gz Oracle JDK 8 is NOT installed. dpkg: error processing package oracle-java8-installer (--configure): subprocess installed post-installation script returned error exit status 1 Setting up chromium-browser (49.0.2623.108-0ubuntu0.14.04.1.1113) ... Setting up chromium-browser-l10n (49.0.2623.108-0ubuntu0.14.04.1.1113) Errors were encountered while processing: oracle-java8-installer E: Sub-process /usr/bin/dpkg returned an error code (1)

    – BalaajiChander Apr 20 '16 at 09:34

2 Answers2

5

it seems that your download is corrupted.

[..] sha256sum mismatch jdk-8u77-linux-i586.tar.gz [..]

Try to remove the package

sudo apt-get purge oracle-java8-installer
sudo apt-get clean
sudo apt-get update

then remove the repo and reimport it

sudo add-apt-repository --remove ppa:webupd8team/java
sudo apt-get update
sudo apt-add-repository ppa:webupd8team/java

and reinstall the package

sudo apt-get update
sudo apt-get install oracle-java8-installer

update: if you want to install java you can use this code instead of the last line :

sudo apt install default-jdk
Francesco
  • 101
  • Error : W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3BDAAC08614C4B38 – BalaajiChander Apr 20 '16 at 11:17
  • I have followed all the steps still I am getting the same error Removing outdated cached downloads... sha256sum mismatch jdk-8u77-linux-i586.tar.gz Oracle JDK 8 is NOT installed. dpkg: error processing package oracle-java8-installer (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: oracle-java8-installer E: Sub-process /usr/bin/dpkg returned an error code (1) – BalaajiChander Apr 20 '16 at 11:46
  • @Bachan Did you import the GPG key when you performed "sudo apt-add-repository ppa:webupd8team/java" (at a certain point the terminal asked you "Press [ENTER] to continue or ctrl-c to cancel adding it")? – Francesco Apr 20 '16 at 12:02
  • Yes I pressed [Enter] – BalaajiChander Apr 20 '16 at 12:14
  • I tried again and pressed [Enter], still the same error W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3BDAAC08614C4B38 on sudo apt-get update – BalaajiChander Apr 20 '16 at 12:20
  • the problem is that missing GPG key...have a look at this post http://askubuntu.com/questions/645658/how-to-repair-missing-gpg-public-keys-for-packages – Francesco Apr 20 '16 at 12:41
  • if you can't sort it out you can install the java sdk by downloading it directly form Oracle – Francesco Apr 20 '16 at 12:43
  • the problem was with the firewall in my organization, with restricted download size and bandwidth, so is the corrupt packages problem. I resolved it later. And followed your steps. Installed JDK 8 :) . Thanks. How to enable debug switch in shell for detailed error report ? – BalaajiChander Apr 21 '16 at 11:15
0

I had a similar problem. Looking at /var/cache/oracle-jdk8-installer, I noticed the jdk-8u111-linux-x64.tar.gz was only 5.3kB. I deleted it , downloaded the correct file from http://www.oracle.com/technetwork/java/javase/downloads/index.html and then put it in the /var/cache/oracle-jdk8-installer folder then reran $sudo apt-get install oracle-java8-installer followed by $ sudo apt install oracle-java8-set-default and it installed correctly.