Erro ao configurar o jdk8 no Ubuntu 14.04LTS

7

Eu estava tentando configurar o jdk 8 usando este guia. Depois de baixar o jdk, recebi um erro que me pedia para configurar manualmente o dpkg.

adeen-s@adeen-s-PC:~$ sudo dpkg --configure -a
Setting up oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u66-linux-x64.tar.gz
Removing outdated cached downloads...
mv: cannot move ‘jdk1.8.0_66’ to ‘java-8-oracle/jdk1.8.0_66’: Directory not empty
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
 oracle-java8-set-default depends on oracle-java8-installer; however:
  Package oracle-java8-installer is not configured yet.

dpkg: error processing package oracle-java8-set-default (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 oracle-java8-installer
 oracle-java8-set-default

Como faço para corrigir isso?

UPDATE: Tentei instalar novamente depois de seguir @ A.B. Aconselhamento aqui está a saída - >

2015-11-25 17:56:08 (50.3 KB/s) - ‘jdk-8u66-linux-x64.tar.gz’ saved [181287376/181287376]

Download done. Removing outdated cached downloads... install: cannot stat ‘javaws-wrapper.sh’: No such file or directory dpkg: error processing package oracle-java8-installer (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of oracle-java8-set-default: oracle-java8-set-default depends on oracle-java8-installer; however: Package oracle-java8-installer is not configured yet.

dpkg: error processing package oracle-java8-set-default (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: oracle-java8-installer oracle-java8-set-default

UPDATE: Saída após sudo apt-get expurg oracle-java8-installer

adeen-s@adeen-s-PC:~$ sudo apt-get purge oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  oracle-java8-installer* oracle-java8-set-default*
0 upgraded, 0 newly installed, 2 to remove and 542 not upgraded.
2 not fully installed or removed.
After this operation, 167 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 165086 files and directories currently installed.)
Removing oracle-java8-set-default (8u66+8u65arm-1~webupd8~1) ...
Purging configuration files for oracle-java8-set-default (8u66+8u65arm-1~webupd8~1) ...
Removing oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Purging configuration files for oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
    
por adeen-s 25.11.2015 / 09:53

2 respostas

12

Você usou as duas possibilidades para instalar o Oracle Java

Exclua a pasta e inicie a instalação novamente:

sudo rm -r /usr/lib/jvm/java-8-oracle/jdk1.8.0_66

sudo apt-get install -f
sudo apt-get purge oracle-java8-installer
sudo apt-get install oracle-java8-installer

Depois disso

sudo apt-get install oracle-java8-set-default

Você usa o PPA ou a instalação com um arquivo. Mas não os dois.

    
por A.B. 25.11.2015 / 10:49
2

Poderíamos recuperar o arquivo revertendo para uma versão anterior do JDK. Parece uma solução burra, mas funciona.

$ cd /var/cache/apt/archives
$ sudo dpkg -i oracle-java8-installer_8u77+8u77arm-1~webupd8~1_all.deb
    
por Ruifeng Ma 28.04.2016 / 10:04