码迷,mamicode.com
首页 > 其他好文 > 详细

apt-get dpkg lock 和 debconf 问题

时间:2016-09-30 02:44:25      阅读:480      评论:0      收藏:0      [点我收藏+]

标签:

 

一:

在用sudo apt-get install 安装软件时,由于速度太慢,想换个软件源,直接关闭了终端,apt-get但进程没有结束,结果终端提示

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
E: 无法获得锁 /var/lib/dpkg/lock – open (11: 资源暂时不可用)
E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?

 

解决办法如下:
1 终端输入 ps -aux | grep apt,列出进程。找到含有apt的进程,直接sudo kill PID。解决。
2 强制解锁,命令

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

 

 

二:

debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: 资源暂时不可用

 

Setting up shim-signed (1.19~16.04.1+0.8-0ubuntu2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package shim-signed (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 shim-signed

 

解决方法:

$ sudo lsof /var/cache/debconf/config.dat
lsof: WARNING: cant stat() fuse.gvfs-fuse-daemon file system /home/amw/.gvfs
      Output information may be incomplete.
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
frontend 3350 root    4uW  REG    7,0    40347 2966 /var/cache/debconf/config.dat
$ sudo kill 4250
$ sudo apt-get autoclean
$ sudo apt-get clean
$ sudo apt-get autoremove 
$ sudo apt-get update

 

然后可以试着用apt-get安装软件。

apt-get dpkg lock 和 debconf 问题

标签:

原文地址:http://www.cnblogs.com/drizzlewithwind/p/5922414.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!