我尝试过诸如编辑panasoniclpd.init
文件之类的解决方案,但它也不起作用。每当我尝试从 CLI 更新或安装时,都会显示此问题
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)
答案1
如果无法重新启动并且您可以访问计算机,请尝试以下操作:
1)从错误信息中找到锁定文件的进程ID:
$ 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
:
$ 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)杀死进程。
$ sudo kill -9 44515
4)apt
再次尝试您的命令。