"sudo apt autoremove" 명령이 작동하지 않습니다("/var/cache/debconf/config.dat가 다른 프로세스에 의해 잠겨 있습니다")

"sudo apt autoremove" 명령이 작동하지 않습니다("/var/cache/debconf/config.dat가 다른 프로세스에 의해 잠겨 있습니다")

파일 편집과 같은 솔루션을 시도했지만 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명령을 다시 시도해보세요.

관련 정보