Oracle java 7 Installation on Ubuntu E: Subprocess / usr / bin / dpkg returned error code (1)

I cannot install oracle java 7 following the instructions given in this link: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer 

I get the following:

 Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming The following NEW packages will be installed: oracle-java7-installer 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/18,6 kB of archives. After this operation, 193 kB of additional disk space will be used. Preconfiguring packages ... Selecting previously unselected package oracle-java7-installer. (Reading database ... 273801 files and directories currently installed.) Unpacking oracle-java7-installer (from .../oracle-java7-installer_7u51-0~webupd8~4_all.deb) ... oracle-license-v1-1 license has already been accepted Processing triggers for desktop-file-utils ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for gnome-menus ... Processing triggers for shared-mime-info ... Setting up oracle-java7-installer (7u51-0~webupd8~4) ... Downloading Oracle Java 7... --2014-03-20 12:12:52-- http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz Resolving download.oracle.com (download.oracle.com)... 131.178.7.201 Connecting to download.oracle.com (download.oracle.com)|131.178.7.201|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz [following] --2014-03-20 12:12:52-- https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.204.22.140 Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.204.22.140|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz?AuthParam=1395339292_7fc586697ce74b02fa16cb3ec88d3a9d [following] --2014-03-20 12:12:52-- http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz?AuthParam=1395339292_7fc586697ce74b02fa16cb3ec88d3a9d Connecting to download.oracle.com (download.oracle.com)|131.178.7.201|:80... connected. HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable The file is already fully retrieved; nothing to do. Download done. Removing outdated cached downloads... sha256sum mismatch jdk-7u51-linux-x64.tar.gz Oracle JDK 7 is NOT installed. dpkg: error processing oracle-java7-installer (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: oracle-java7-installer E: Sub-process /usr/bin/dpkg returned an error code (1) 

I also tried to do what is said in https://help.ubuntu.com/community/Java :

 sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get update 

Then:

 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer 

And still no luck :( Can someone help me? I completely lost why it does not work. Thanks in advance.

EDIT: solution found at the following link: https://askubuntu.com/questions/414885/oracle-jdk-7-is-not-installed-error

DECISION:

 sudo dpkg -P oracle-java7-installer sudo apt-get -f install sudo apt-get install oracle-java7-installer 
+6
source share
6 answers

To install oracle java, follow these steps:

Download the latest Java SE SDK.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Cancel archive :

 tar -xzvf jdk-8-linux-x64.tar.gz mv jdk1.8.0 /opt cd /opt/jdk1.8.0 

This step registers the downloaded version of Java as an alternative and switches it to use by default:

 update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1 update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1 update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so 1 update-alternatives --set java /opt/jdk1.8.0/bin/java update-alternatives --set javac /opt/jdk1.8.0/bin/javac update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so 

Test

To check the Java version, you now run

 java -version 

Output

 java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode) 

To check the browser plugin, go to http://www.java.com/ and click on "Do I have Java?"

Link: https://askubuntu.com/questions/437776/ubuntu-13-04-unable-to-install-jdk7

+15
source
  • install synaptic if not installed before.
  • open synaptic packet manager.
  • search jdk.
  • to remove all installed jdk package.
  • applied to delete.
  • to install openjdk-8-jdk .
  • applies.
  • N-joy.

enter image description here

+2
source

sudo dpkg -P oracle-java7-installer

sudo apt-get -f install

+1
source

I think that your download is damaged, you need to first remove the damaged package by code:

 sudo apt-get purge oracle-java7-installer 

clear your apt:

 sudo apt clean 

remove and reimport rotopography:

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

install the package again:

 sudo apt-get install oracle-java7-installer 

enjoy your brother! if the problem persists, try using a VPN. There may be filtering between you and the oracle website.

+1
source

The reason is this: WHY ORACLE JAVA 7 AND 6 INSTALLERS DO NOT WORK

If you have an Oracle Support account, and you really need Oracle JDK 6 or 7, you can get installers from WebUpd8 PPU to work by downloading the binaries and placing them in the following folder:

  • / var / cache / oracle-jdk6-installer / for JDK 6 (you will need version 6u45)
  • / var / cache / oracle-jdk7-installer / for JDK 7 (you will need version 7u80 for 32-bit and 64-bit or 7u60 for the hand).

... and then install the oracle-java6-installer or oracle-java7-installer package.

0
source

I tried the solution, but still did not work. Even when I tried to download jdk-tar from the Oracle site, it still failed by about 30-50 MB. Anyway, I found an article that talks about this, and finally it has been fixed!

Oracle adds oracle-java7-installer license and now it does not work (published in March 2014)

Basically the steps are similar, with the exception of the last:

 sudo apt-get update sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer 
-1
source

All Articles