Ubuntu – Get error on install Java

aptjavaoracle

I tried install Java 8 for Oracle PPA but get a error. I have viewed “sha256sum mismatch jdk-7u3-linux-x64.tar.gz ” error when trying to install Oracle Java and How to remove error message when installing new softwares these two article and tried to fix it but failed. Can anyone help me with this?

1st Attempt Install Log:

sysadmin@VM-ELK-ES:~$ sudo apt-get install oracle-java8-installer 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils gsfonts gsfonts-x11 java-common libfontenc1 libxfont1 x11-common
  xfonts-encodings xfonts-utils
Suggested packages:
  binutils-doc default-jre equivs binfmt-support visualvm ttf-baekmuk
  ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic
  ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming firefox firefox-2
  iceweasel mozilla-firefox iceape-browser mozilla-browser epiphany-gecko
  epiphany-webkit epiphany-browser galeon midbrowser moblin-web-browser
  xulrunner xulrunner-1.9 konqueror chromium-browser midori google-chrome
The following NEW packages will be installed:
  binutils gsfonts gsfonts-x11 java-common libfontenc1 libxfont1
  oracle-java8-installer x11-common xfonts-encodings xfonts-utils
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,429 kB of archives.
After this operation, 19.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main libfontenc1 amd64 1:1.1.2-1 [15.6 kB]
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main oracle-java8-installer all 8u45+8u33arm-1~webupd8~0 [22.1 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libxfont1 amd64 1:1.4.7-1ubuntu0.2 [95.0 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu3.1 [2,076 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main java-common all 0.51 [130 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/main gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1 [3,374 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main x11-common all 1:7.7+1ubuntu8.1 [49.5 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty/main xfonts-encodings all 1:1.0.4-1ubuntu1 [583 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty/main xfonts-utils amd64 1:7.7+1 [73.9 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty/main gsfonts-x11 all 0.22 [9,108 B]
Fetched 6,429 kB in 21s (298 kB/s)                                             
Preconfiguring packages ...
Selecting previously unselected package libfontenc1:amd64.
(Reading database ... 58551 files and directories currently installed.)
Preparing to unpack .../libfontenc1_1%3a1.1.2-1_amd64.deb ...
Unpacking libfontenc1:amd64 (1:1.1.2-1) ...
Selecting previously unselected package libxfont1:amd64.
Preparing to unpack .../libxfont1_1%3a1.4.7-1ubuntu0.2_amd64.deb ...
Unpacking libxfont1:amd64 (1:1.4.7-1ubuntu0.2) ...
Selecting previously unselected package binutils.
Preparing to unpack .../binutils_2.24-5ubuntu3.1_amd64.deb ...
Unpacking binutils (2.24-5ubuntu3.1) ...
Selecting previously unselected package java-common.
Preparing to unpack .../java-common_0.51_all.deb ...
Unpacking java-common (0.51) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up binutils (2.24-5ubuntu3.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Selecting previously unselected package oracle-java8-installer.
(Reading database ... 58793 files and directories currently installed.)
Preparing to unpack .../oracle-java8-installer_8u45+8u33arm-1~webupd8~0_all.deb ...
Unpacking oracle-java8-installer (8u45+8u33arm-1~webupd8~0) ...
Selecting previously unselected package gsfonts.
Preparing to unpack .../gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.2ubuntu1_all.deb ...
Unpacking gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
Selecting previously unselected package x11-common.
Preparing to unpack .../x11-common_1%3a7.7+1ubuntu8.1_all.deb ...
Unpacking x11-common (1:7.7+1ubuntu8.1) ...
Selecting previously unselected package xfonts-encodings.
Preparing to unpack .../xfonts-encodings_1%3a1.0.4-1ubuntu1_all.deb ...
Unpacking xfonts-encodings (1:1.0.4-1ubuntu1) ...
Selecting previously unselected package xfonts-utils.
Preparing to unpack .../xfonts-utils_1%3a7.7+1_amd64.deb ...
Unpacking xfonts-utils (1:7.7+1) ...
Selecting previously unselected package gsfonts-x11.
Preparing to unpack .../gsfonts-x11_0.22_all.deb ...
Unpacking gsfonts-x11 (0.22) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libfontenc1:amd64 (1:1.1.2-1) ...
Setting up libxfont1:amd64 (1:1.4.7-1ubuntu0.2) ...
Setting up java-common (0.51) ...
Setting up oracle-java8-installer (8u45+8u33arm-1~webupd8~0) ...
Downloading Oracle Java 8...
--2015-05-25 07:22:54--  http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
Connecting to 192.168.191.51:3142... connected.
Proxy request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: ‘jdk-8u45-linux-x64.tar.gz’

     0K                                                      100% 38.5M=0s

2015-05-25 07:22:55 (38.5 MB/s) - ‘jdk-8u45-linux-x64.tar.gz’ saved [5307/5307]

Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-8u45-linux-x64.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 gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
Setting up x11-common (1:7.7+1ubuntu8.1) ...
 * Setting up X socket directories...                                                                                        [ OK ] 
Processing triggers for ureadahead (0.100.0-16) ...
Setting up xfonts-encodings (1:1.0.4-1ubuntu1) ...
Setting up xfonts-utils (1:7.7+1) ...
Setting up gsfonts-x11 (0.22) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

2nd Attempt:

After following the instruction at first article

sysadmin@VM-ELK-ES:~$ sudo apt-get install oracle-java8-installer 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  binfmt-support visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core
  ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho
  ttf-arphic-uming firefox firefox-2 iceweasel mozilla-firefox iceape-browser
  mozilla-browser epiphany-gecko epiphany-webkit epiphany-browser galeon
  midbrowser moblin-web-browser xulrunner xulrunner-1.9 konqueror
  chromium-browser midori google-chrome
The following NEW packages will be installed:
  oracle-java8-installer
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.1 kB of archives.
After this operation, 221 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package oracle-java8-installer.
(Reading database ... 59085 files and directories currently installed.)
Preparing to unpack .../oracle-java8-installer_8u45+8u33arm-1~webupd8~0_all.deb ...
oracle-license-v1-1 license has already been accepted
Unpacking oracle-java8-installer (8u45+8u33arm-1~webupd8~0) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up oracle-java8-installer (8u45+8u33arm-1~webupd8~0) ...
Downloading Oracle Java 8...
--2015-05-25 07:31:01--  http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
Connecting to 192.168.191.51:3142... connected.
Proxy request sent, awaiting response... 416 Invalid range: 5307-

    The file is already fully retrieved; nothing to do.

Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-8u45-linux-x64.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)

NOTICE: I have use apt-cacher as a apt proxy by following this

Best Answer

Answer taken from OPs question:

SOLVED: The problem was cause by the apt-cacher, I have opened a new post, welcome anyone come and help me to solve the new problem.