尝试安装软件,但每次出现“config”时都会出现错误:/var/cache/debconf/config.dat 被锁定

尝试安装软件,但每次出现“config”时都会出现错误:/var/cache/debconf/config.dat 被锁定

我尝试了这里发布的很多解决方案,但都不起作用。我正在尝试安装 vlc。这是整个输出。

:/$ sudo apt-get install vlc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
vlc is already the newest version (2.2.2-5).
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.
Do you want to continue? [Y/n] Y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up libpam-systemd:amd64 (229-4ubuntu13) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package libpam-systemd:amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

从给定的日志报告中我们发现该/var/cache/debconf/config.dat文件已被其他进程锁定。

我们必须 /var/cache/debconf/config.dat从该流程中发布文件。

打开终端并输入lsof /var/cache/debconf/config.dat,您将获得正在使用config.dat文件的进程名称,然后使用以下任一方式终止该进程

kill <space> PID

或者

kill <space> -9 <space> PID

然后重试。

希望它会有所帮助。

相关内容