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 getting the following error while trying to install default-jre. How can I solve this issue?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.

The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 1:1.7-43ubuntu4) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
share|improve this question

marked as duplicate by karel, Eric Carvalho, Warren Hill, bain, Radu Rădeanu Jul 11 at 18:35

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.

2 Answers 2

Try Code:

sudo apt-get update

to update your package list. Then Code:

sudo apt-get autoclean

to clean up any partial packages. Then Code:

sudo apt-get clean

to clean up the apt cache. Code:

sudo apt-get autoremove

will clean up any unneeded dependencies. If while doing this you can identify the broken package this code will very forcefully remove it. Code:

sudo dpkg --remove -force --force-remove-reinstreq package name

Change package name to the real name of course.

share|improve this answer

Use aptitude instead of apt,

sudo apt-get install aptitude
sudo aptitude -f install
share|improve this answer
    
I tried this but I am getting the following error. The following packages have unmet dependencies: tzdata-java : Depends: tzdata (= 2013g-0ubuntu0.13.04) but 2014e-0ubuntu0.12.04 is installed. –  shaikh Jul 9 at 6:16
    
It seems you have saturated apt-get database. Then, the dependencies hell happened. Have you tried with sudo aptitude -f install default-jre? –  bagustris Jul 9 at 6:41

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