Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

First I had installed oracle java via terminal. its get en error. I don't remember the error message. but other java app are working example netbeans, eclipse. The main problem is when i installed any new softwares via terminal or ubuntu software center, first i get this error.

sha256sum mismatch jdk-7u3-linux-i586.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)

How to remove this message and and reinstall java properly. I'm using Ubuntu 12.04

EDIT When i trying to remove the Sun Java(TM) Development Kit (JDK) 7 i got this error message.

installArchives() failed: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 189962 files and directories currently installed.)
Removing oracle-java7-installer ...
update-alternatives: error: unknown argument `cdrom'
dpkg: error processing oracle-java7-installer (--remove):
 subprocess installed pre-removal script returned error exit status 2
No apport report written because MaxReports is reached already
Downloading...
--2012-05-21 22:54:41--  http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving download.oracle.com (download.oracle.com)... 222.165.168.249, 222.165.168.202
Connecting to download.oracle.com (download.oracle.com)|222.165.168.249|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz [following]
--2012-05-21 22:54:42--  https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 173.222.122.174
Connecting to edelivery.oracle.com (edelivery.oracle.com)|173.222.122.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2012-05-21 22:54:43--  http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|222.165.168.249|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-i586.tar.gz'

     0K .....                                                 100%  152K=0.03s

2012-05-21 22:54:43 (152 KB/s) - `./jdk-7u3-linux-i586.tar.gz' saved [5307/5307]

Download done.
sha256sum mismatch jdk-7u3-linux-i586.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java7-installer
share|improve this question
    
Possible duplicate of askubuntu.com/questions/126372/…. If the solution there doesn't work for you, please comment here to indicate it didn't help (but it probably will). –  Eliah Kagan May 23 '12 at 14:28

3 Answers 3

Running these commands should fix your problem:

sudo apt-get update
sudo apt-get --purge reinstall oracle-java7-installer
sudo apt-get upgrade

If they do not, then please edit your question to include all the text from the Terminal from when you ran them (as the output would still be diagnostically useful).

share|improve this answer
    
Its not working still i got that error. and I updated the question again. –  Mifas May 21 '12 at 17:27
    
@Mifas If you want to continue trying to get the method you're using to work, then please also provide the output of apt-cache policy oracle-java7-installer in your question. But you might consider using this method instead. –  Eliah Kagan May 21 '12 at 17:31
1  
@Mifas If the solution at askubuntu.com/questions/126372/… does work for you, please comment here and I'll delete this answer (because that would mean this answer is just a less-good version of that answer). –  Eliah Kagan May 23 '12 at 14:29
    
jeb@AMD-Athlon-II-X3:~$ apt-cache policy oracle-java7-installer oracle-java7-installer: Installed: 7u3-0~eugenesan~precise4 Candidate: 7u5-0~webupd8~5 Version table: 7u5-0~webupd8~5 0 500 ppa.launchpad.net/webupd8team/java/ubuntu precise/main amd64 Packages *** 7u3-0~eugenesan~precise4 0 100 /var/lib/dpkg/status jeb@AMD-Athlon-II-X3:~$ –  Jebeld17 Jul 25 '12 at 20:43

The fix is quite simple, actually. Please install Synaptic Package Manager in the Ubuntu Software Center, first. After installed, you will need to open it with root privilages:

sudo synaptic

Search for Oracle-java7-installer, right click on it, and completely remove it. Apply the changes, remove the PPA, and your error messages will be gone.enter image description here

share|improve this answer
    
+1 Had sha256sum mismatch with oracle-java8-installer using synaptic and marking for complete removal then reinstalling worked for me. –  earcam Jun 13 '13 at 0:34

Synaptic Package Manager is very useful in removing a file which has a dependency issue, and particularly when sudo apt-get install -f does not work.

share|improve this answer
    
Are you sure about that? Surely Synaptic would be running the same code to try and remove the broken package. –  James Henstridge Aug 2 '12 at 1:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.