在 Ubuntu 14.04上,安装jdk8时软件安装错误

分享于 

4分钟阅读

ubuntu

  繁體

问题

我试图设置jdk 8,下载jdk后,我得到了一个错误,要求我手动配置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



该如何解决?

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

sudo apt-get purge 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) ...




答案1

删除文件夹,并再次启动安装:


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



在那之后


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



要么使用PPA,要么使用归档文件安装,但不能两种方法混合。


答案2

通过恢复到以前的JDK版本来恢复文件,这是一个愚蠢的解决方案,但它有效。


$ cd /var/cache/apt/archives


$ sudo dpkg -i oracle-java8-installer_8u77+8u77arm-1~webupd8~1_all.deb





SET  Ubuntu  Setting  jdk  jdk8  
相关文章