dockerのubuntuの中でdstatの代替のpcpをインストールすると中途半端にインストールされてエラーになってしまう。
削除もできない。force等つけてもだめ。
# apt purge pcp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libbpf1 libpcp-archive1t64 libpcp-gui2t64 libpcp-import1t64 libpcp-mmv1t64 libpcp-pmda-perl libpcp-pmda3t64
libpcp-trace2t64 libpcp-web1t64 libpcp3t64 libpfm4 pcp-conf python3-pcp
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
pcp*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 14.7 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 126408 files and directories currently installed.)
Removing pcp (6.2.0-1.1build4) ...
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 pcp (--remove):
installed pcp package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
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 while cleaning up:
installed pcp package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
pcp
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
initがPID 1にいないためな模様。
正しいやり方か分からないが/var/lib/dpkg/info/pcp.prermの先頭あたりに「exit 0」を追加してpurgeすれば消せる。