apt-get dpkg lock 和 debconf 问题

一:

在用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: can‘t 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安装软件。

时间: 2024-10-07 22:01:58

apt-get dpkg lock 和 debconf 问题的相关文章

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

原因:历史软件(包)更新(安装)未完成就退出了系统 解决办法:杀死该进程 sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock 为防止类似情况发生,可以执行以下命令 sudo dpkg --configure -a sudo apt-get update 即使运行sudo dpkg --configure -a也不能解决问题,那就将错误的更新包删除并尝试重新更新 sudo rm /var/lib/dpkg/updates/

linux 遇见错误Could not get lock /var/lib/dpkg/lock

通过终端安装程序sudo apt-get install xxx时出错: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: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用.而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况. 解决方法:输入以下命令 sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock 之后再安装想装的包,即可解决 今天玩ubuntu的时候,在弄更新源的时候,突然出现以下错误: [1]+ Stopped                 sudo apt-get update[email pro

【转】ubunt 安装 yum出现 ubuntu 解决“无法获得锁 /var/lib/dpkg/lock -open (11:资源暂时不可用)”的方法

今天本来是用xshell 链接本地的linux的,然而链接的时候没有主动弹出输入 用户名和密码的对话框,google搜了下,遇到了上面的问题. 解决办法如下:1.终端输入 ps  aux ,列出进程.找到含有apt-get的进程,直接sudo kill PID. 2.强制解锁,命令sudo rm /var/cache/apt/archives/locksudo rm /var/lib/dpkg/lock 2.又提示安装yum命令: apt install yum 3.因为我要使用service

无法获得锁 /var/lib/dpkg/lock - open (11: 资源临时不可用)

转自:http://www.cnblogs.com/ManMonth/archive/2010/01/14/1648010.html 问题: 运行程序更新时出现报错: 解决:其实这是因为有另外一个程序在运行,导致锁不可用.原因可能是上次运行更新或安装没有正常完成.解决办法是杀死此进程sudo rm /var/cache/apt/archives/locksudo rm /var/lib/dpkg/lock

ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决

通过终端安装程序sudo apt-get install xxx时出错:(或者卸载的时候) 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? 出现这个问题可能是有另外一个程序正在运行,导致资

【ubuntu 】常见错误--Could not get lock /var/lib/dpkg/lock

ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock 通过终端安装程序sudo apt-get install xxx时出错: 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

【Linux/Ubuntu学习 7】E: 无法获得锁 /var/lib/dpkg/lock – open (11: 资源暂时不可用) E: 无法锁定管理目录

在用sudo apt-get install 安装软件时,由于速度太慢,想换个软件源,直接关闭了终端,apt-get但进程没有结束,结果终端提示 :“E: 无法获得锁 /var/lib/dpkg/lock – open (11: 资源暂时不可用) E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?” 解决办法如下: 1 终端输入 ps -aux ,列出进程.找到含有apt‘-get的进程,直接sudo kill PID.解决. 2 强制解锁,命令 sudo rm /

(八)ubuntu安装软件提示:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)

question: [email protected]:/usr/src/Linux-headers-3.5.0-23-generic$ sudo apt-get install cheese [sudo] password for ubuntu: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to lock the administration di