Eu desinstalei o java seguindo istotutoriale então tentei instalá-lo novamente. Eu digitei:
sudo apt-get update
tudo bem e então eu executo isso sudo apt-get install default-jdk
e recebo:
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-jdk : Depends: default-jre (= 1:1.6-43ubuntu2)
Depends: openjdk-6-jdk (>= 6b23~pre11-1ubuntu1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Como posso resolver isso, por favor?
eu tentei
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get -f install
que imprime
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
então:
sudo dpkg --configure -a
sudo apt-get -f install
que imprime
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Eu também tentei:
sudo apt-get install -f default-jre openjdk-6-jdk # I also get the same error without the -f option
que imprime:
The following packages have unmet dependencies:
default-jre : Depends: openjdk-6-jre (>= 6b23~pre11-1ubuntu1~)
openjdk-6-jdk : Depends: openjdk-6-jre (= 6b39-1.13.11-0ubuntu0.12.04.1)
Recommends: libxt-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Responder1
Tentei instalar sudo apt-get install openjdk-6-jre
e percebi que faltava algum outro pacote. Então tentei instalar esse pacote e então faltava algum outro pacote.
Depois de 3 vezes, instalei o último pacote com sucesso e comecei a instalar todos os pacotes que faltavam no final, e finalmente instalei!