wsl@Ubuntu2004:~$ sudo dpkg -P keydb-server
(Reading database ... 54459 files and directories currently installed.)
Removing keydb-server (6:6.2.1-1~focal1) ...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package keydb-server (--purge):
installed keydb-server package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
keydb-server
wsl@Ubuntu2004:~$ dpkg -l
...
keydb-server
...
wsl@Ubuntu2004:~$ keydb-server
keydb-server: command not found
wsl@Ubuntu2004:~$ mkdir -p ~/backup/dpkg/
wsl@Ubuntu2004:~$ sudo cp /var/lib/dpkg/status ~/backup/dpkg/
wsl@Ubuntu2004:~$ sudo vim /var/lib/dpkg/status
wsl@Ubuntu2004:~$ sudo apt install graphviz
删除keydb相关行
wsl@Ubuntu2004:~$ sudo apt install graphviz
...
Do you want to continue? [Y/n] y
dpkg: unrecoverable fatal error, aborting:
unknown system user 'keydb' in statoverride file; the system user got removed
before the override, which is most probably a packaging bug, to recover you
can remove the override manually with dpkg-statoverride
E: Sub-process /usr/bin/dpkg returned an error code (2)
wsl@Ubuntu2004:~$ grep 'keydb' /var/lib/dpkg/statoverride
keydb keydb 640 /etc/keydb/keydb.conf
wsl@Ubuntu2004:~$ sudo dpkg-statoverride --remove /etc/keydb/keydb.conf