本次通过ssh远程安装软件过程中出现了断网,造成再次安装它时提示:
root@netren:~# apt-get install sun-java6-jre
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavai lable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another proc ess using it?
这个问题很显然是由于上次安装未完成造成的,由于ssh重新登录无法再回到原来的界面。所以要解决此问题方法有几种:
方法一、
1、ps aux #找出相关进程ID
www-data 22193 0.0 0.2 33024 4872 ? S Apr15 0:00 /usr/sbin/apache2 -k start
root 28226 0.0 0.9 23788 19528 ? S Apr15 0:02 apt-get install sun-java6-jr
root 28481 0.0 0.5 13632 10912 pts/1 Ss+ Apr15 0:00 /usr/bin/dpkg --status-fd 22 --unpack --auto-deconfigure /var/cache/apt/archives/sun-java6-jre_6.24-1bu
root 30806 0.0 0.1 10444 3208 ? Ss Apr15 0:00 sshd: root@pts/2
root 30887 0.0 0.0 4592 1904 pts/2 Ss Apr15 0:00 -bash
root 28487 0.0 0.3 10536 7496 pts/1 S+ Apr15 0:00 /usr/bin/perl -w /usr/share/
root 28494 0.0 0.0 1832 540 ? S Apr15 0:00 /bin/sh -e /var/lib/dpkg/tmp.ci/preinst install
root 28496 0.0 0.0 4764 1488 ? R Apr15 0:02 whiptail --backtitle Package configuration --title Configuring sun-java6-jre --output-fd 11 --msgbox Op
2、Kill xxxx #关掉进程ID
3、运行root@netren:~# dpkg --configure -a 否则会提示:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
转载于:https://blog.51cto.com/netren/592087