首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"sudo apt自动删除“命令不起作用("/var/cache/debconf/config.dat被另一个进程锁定”)

"sudo apt自动删除“命令不起作用("/var/cache/debconf/config.dat被另一个进程锁定”)
EN

Unix & Linux用户
提问于 2020-03-09 11:25:36
回答 1查看 713关注 0票数 0

我尝试过像在panasoniclpd.init文件上进行编辑这样的解决方案,但它也不起作用。每当我尝试从CLI更新或安装时,都会显示此问题。

代码语言:javascript
复制
sudo apt autoremove
[sudo] password for lahlohi: 
Sorry, try again.
[sudo] password for lahlohi: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up unattended-upgrades (1.1ubuntu1.18.04.14) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package unattended-upgrades (--configure):
 installed unattended-upgrades package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 unattended-upgrades
E: Sub-process /usr/bin/dpkg returned an error code (1)
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2020-03-09 11:48:28

如果重新启动不是一个选项,并且您可以访问该机器,请尝试以下操作:

1)查找从错误消息锁定文件的进程ID:

代码语言:javascript
复制
$ sudo lsof /var/cache/debconf/config.dat
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
frontend 44515 root 4uW REG 252,0 60012 55592027 /var/cache/debconf/config.dat

2)通过ps检查流程:

代码语言:javascript
复制
$ sudo ps auxf | grep 44515
root 44515 0.0 0.0 60700 2196 pts/0 S+ Feb18 0:00 | _ /usr/bin/perl -w 
/usr/share/debconf/frontend /var/lib/dpkg/info/postfix.postinst configure 3.1.0-3ubuntu0.2

3)扼杀过程。

代码语言:javascript
复制
$ sudo kill -9 44515

4)再次尝试apt命令。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/571943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档