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.

This question already has an answer here:

I am trying to do sudo apt-get upgrade and I am having the following issues. I am not able to install any package also.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 icedtea-6-jre-cacao : Depends: openjdk-6-jre-headless (= 6b27-1.12.1-2ubuntu0.12.04.2) but 6b27-1.12.3-0ubuntu1~12.04 is installed
 icedtea-6-jre-jamvm : Depends: openjdk-6-jre-headless (= 6b27-1.12.1-2ubuntu0.12.04.2) but 6b27-1.12.3-0ubuntu1~12.04 is installed
 icedtea-7-jre-jamvm : Depends: openjdk-7-jre-headless (= 7u13-2.3.6-0ubuntu0.12.04.1) but 7u15-2.3.7-0ubuntu1~12.04 is installed
 openjdk-6-jre-headless : Depends: openjdk-6-jre-lib (>= 6b27-1.12.3-0ubuntu1~12.04) but 6b27-1.12.1-2ubuntu0.12.04.2 is installed
                          Recommends: icedtea-6-jre-cacao (= 6b27-1.12.3-0ubuntu1~12.04) but 6b27-1.12.1-2ubuntu0.12.04.2 is installed
                          Recommends: icedtea-6-jre-jamvm (= 6b27-1.12.3-0ubuntu1~12.04) but 6b27-1.12.1-2ubuntu0.12.04.2 is installed
 openjdk-7-jre : Depends: openjdk-7-jre-headless (= 7u13-2.3.6-0ubuntu0.12.04.1) but 7u15-2.3.7-0ubuntu1~12.04 is installed
 openjdk-7-jre-headless : Depends: openjdk-7-jre-lib (= 7u15-2.3.7-0ubuntu1~12.04) but 7u13-2.3.6-0ubuntu0.12.04.1 is installed
                          Recommends: icedtea-7-jre-jamvm (= 7u15-2.3.7-0ubuntu1~12.04) but 7u13-2.3.6-0ubuntu0.12.04.1 is installed
E: Unmet dependencies. Try using -f.

'sudo apt-get -f install' giving the following output.`No apport report written because the error message indicates its a followup error from a previous failure.

                                                                                                          Errors were encountered while processing:
 openjdk-7-jre-headless
 openjdk-6-jre-headless
 openjdk-6-jre-lib
 default-jre-headless
 icedtea-6-jre-cacao
 icedtea-6-jre-jamvm
 default-jre
 openjdk-6-jre
 openjdk-7-jre
 icedtea-7-jre-jamvm
 icedtea-netx
 openjdk-7-jre-lib
 ca-certificates-java
 libatk-wrapper-java
 libatk-wrapper-java-jni
E: Sub-process /usr/bin/dpkg returned an error code (1)

`

Following is the content of my /etc/apt/sources.list file.


> deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
> deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse
> 
> ## N.B. software from this repository may not have been tested as
> ## extensively as that contained in the main release, although it includes
> ## newer versions of some applications which may provide useful features.
> ## Also, please note that software in backports WILL NOT receive any review
> ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu precise-backports main restricted
> universe multiverse deb-src http://archive.ubuntu.com/ubuntu
> precise-backports main restricted universe multiverse
> 
> deb http://archive.ubuntu.com/ubuntu precise-security main restricted
> deb-src http://archive.ubuntu.com/ubuntu precise-security main
> restricted deb http://archive.ubuntu.com/ubuntu precise-security
> universe deb-src http://archive.ubuntu.com/ubuntu precise-security
> universe deb http://archive.ubuntu.com/ubuntu precise-security
> multiverse deb-src http://archive.ubuntu.com/ubuntu precise-security
> multiverse
> 
> ## Uncomment the following two lines to add software from Canonical's
> ## 'partner' repository.
> ## This software is not part of Ubuntu, but is offered by Canonical and the
> ## respective vendors as a service to Ubuntu users.
> # deb http://archive.canonical.com/ubuntu precise partner
> # deb-src http://archive.canonical.com/ubuntu precise partner
> 
> ## This software is not part of Ubuntu, but is offered by third-party
> ## developers who want to ship their latest software. deb http://extras.ubuntu.com/ubuntu precise main deb-src
> http://extras.ubuntu.com/ubuntu precise main deb
> http://orange.biolab.si/debian squeeze main deb-src
> http://orange.biolab.si/debian squeeze main
share|improve this question

marked as duplicate by Florian Diesch, qbi, Eliah Kagan, vasa1, Seth Mar 2 '13 at 2:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
And running sudo apt-get -f install returns? –  Bruno Pereira Mar 1 '13 at 20:18
    
I have tried it. But still same problem. –  Satya Mar 1 '13 at 20:21
    
Yes, but do you get a different output from this? –  Bruno Pereira Mar 1 '13 at 20:22
    
I cannot install,remove or upgrade. While trying to open synaptic I am getting Broken packages error. –  Satya Mar 1 '13 at 20:24
1  
@Satya You've provided information about some of the methods/commands there and what happened when you ran them, but you've not provided information about all of them. There's a lot suggested there. Right now it's unlikely anyone could answer this question, except by suggesting various options from there that you haven't tried, or haven't reported on, yet. So we may still close this as a duplicate. If we do, but you provide additional information (detailing everything you did and everything that happened, so it's clear that nothing there helped and why), then this can be reopened. –  Eliah Kagan Mar 2 '13 at 0:06

1 Answer 1

Try :

sudo apt-get update
sudo apt-get -f install

if didn't work then give us the contents of /etc/apt/sources.list

Edit: So, purge jdk using sudo apt-get purge openjdk* then do commands from upper lines.

share|improve this answer
    
I am not able to add the contents as it is exceeding the comment limit and I am very new to this interface.I will edit my post.Please see there. –  Satya Mar 1 '13 at 20:40
    
I tried. But not yet solved. –  Satya Mar 1 '13 at 20:56

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