Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed java JDK following this tutorial:

The installation was ok but every time I install or uninstall anything, I get this message:

--2012-08-08 22:12:26--
Resolving, Connecting
to||:80... connected. HTTP request
sent, awaiting response... 302 Moved Temporarily Location:
--2012-08-08 22:12:26--
Resolving Connecting to||:443... connected. HTTP request
sent, awaiting response... 302 Moved Temporarily Location:
--2012-08-08 22:12:27--
Connecting to||:80... connected. HTTP
request sent, awaiting response... 200 OK Length: 5307 (5.2K)
[text/html] Saving to: `./jdk-7u3-linux-x64.tar.gz'

      0K .....                                                 100%  416K=0.01s

2012-08-08 22:12:27 (416 KB/s) - `./jdk-7u3-linux-x64.tar.gz' saved

Download done. sha256sum mismatch jdk-7u3-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 Setting up firefox
(14.0.1+build1-0ubuntu0.11.10.1) ... Please restart all running
instances of firefox, or you will experience problems. Setting up
firefox-globalmenu (14.0.1+build1-0ubuntu0.11.10.1) ... Errors were
encountered while processing:  oracle-java7-installer E: Sub-process
/usr/bin/dpkg returned an error code (1)

I have checked my sources.list and the is no reference to this.

How to remove this code from trying to install it every time?

share|improve this question

Java isn't installing correctly so every time you try to install something, apt attempts to fix that package. Looking at the output there it's failing to download (every time it downloads the java package, it is corrupt). You have two options.

1) Keep letting it try until it finally successfully downloads the package. 2) Uninstall oracle-java7-installer

share|improve this answer
up vote 0 down vote accepted

Problem solved, running these commands:

Just looking for any Java installer I found it in this directory and removed it

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*

Run this if you have any Java repository on your sources.list, it was not my case.

sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
share|improve this answer
Just a warning for others: Don't modify or delete files in /var/lib/dpkg unless you're absolutely sure you know what you're doing. – bseibold Aug 9 '12 at 7:03
Yes, I did that because I new what the problem was. – Gerep Aug 9 '12 at 19:12

Your Answer


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.