安装 Java 8 dpkg 被中断

安装 Java 8 dpkg 被中断

我正在尝试按照以下链接安装 Java 8

http://linuxg.net/how-to-install-oracle-java-jdk-678-on-ubuntu-13-04-12-10-12-04/ http://ubuntuhandbook.org/index.php/2013/07/install-oracle-java-6-7-8-on-ubuntu-13-10/

但这就是我得到的

sudo apt-get purge openjdk*

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 


sudo apt-get 更新

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

事实上我先尝试了一下sudo apt-get install oracle-java8-installer,但花了太长时间,所以过了一会儿我就放弃了。如果我跑了

sudo dpkg --configure -a
Setting up oracle-java8-installer (8b121-0~webupd8~0) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java8-installer

即使我跑

sudo dpkg --clear-avail && sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

我也在另一个问题中看到了它所以我尝试了一下。

ps aux | grep apt | grep -v 'grep'
root      2597  0.0  0.7  35084 14732 ?        SNl  18:26   0:01 /usr/bin/python /usr/sbin/aptd

有人能解释一下为什么会发生这种情况,以及这是什么lockdpgk

答案1

我所要做的就是重新启动系统并运行

sudo dpkg --configure -a

安装被中断,所以这就是这些消息的原因。

相关内容