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

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 '14 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.

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 '14 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 '14 at 6:41

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

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