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

When I try to run this :

sudo apt-get install groovy 

I get this big error :

Setting up oracle-java7-installer (7u3-0~eugenesan~precise4) ...
--2012-04-28 18:43:39--
Resolving (,
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2012-04-28 18:43:39--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2012-04-28 18:43:40--
Connecting to (||: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% 47.2K=0.1s

2012-04-28 18:43:40 (47.2 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 processing oracle-java7-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of groovy:
 groovy depends on default-jre-headless | sun-java6-jre; however:
  Package default-jre-headless is not installed.
  Package oracle-java7-installer which provides default-jre-headless is not configured yet.
  Package sun-java6-jre is not installed.
dpkg: error processing groovy (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I already have Java installed in my pc. When I run :

java -version

I get :

java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)

where I'm making mistake?

Thanks in advance.

share|improve this question
up vote 17 down vote accepted

I recovered from this error by doing :

sudo apt-get purge openjdk*

This will prompt you to remove the openjdk that have been installed in your system. Proceed with it. After the openjdk have been removed from your pc, you can do :

sudo apt-add-repository ppa:groovy-dev/groovy
sudo apt-get update
sudo apt-get install groovy

This installs the stable version. After that do this, in your terminal :

groovy -version

This should give you the output :

Groovy Version: 1.8.6 JVM: 1.6.0_24 Vendor: Sun Microsystems Inc. OS: Linux
share|improve this answer
+1 excellent - dont forget to click the tick button to accept your own answer. Thanks! – fossfreedom Apr 29 '12 at 10:13
Since the above PPA repository is quite outdated/unmaintained, I'd also recommend using the GVM way to install Groovy as stated in the answer below. – Ikon Jun 27 '15 at 13:10

Instead, I simply installed the GVM (Groovy enVironment Manager) and used that to install groovy.

share|improve this answer

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.