Solution for "dpkg: unknown user / system group in statoverride file"

When I was deploying my Raspberry Pi for my new project, dpkg reported a unrecoverable fatal error while installing dependencies,

dpkg: unrecoverable fatal error, aborting:
 unknown system group 'ssl-cert' in statoverride file; the system group 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)

So I had a look at the file /var/lib/dpkg/statoverride

Since dpkg said that the system group ssl-cert was already removed, and to recover I need to remove these entries with ssl-cert.

Then it was time for sed, let's remove the lines containing ssl-cert

sed -i '/ssl-cert/d' /var/lib/dpkg/statoverride

By the way, if the error message was something like

 unknown system group 'GROUP_NAME'; in statoverride file; the system group got removed

Or it can be

 unknown user 'USER_NAME'; in statoverride file; the user got removed

Then you may just replace them with ssl-cert in the above sed command

sed -i '/GROUP_NAME/d' /var/lib/dpkg/statoverride sed -i '/USER_NAME/d' /var/lib/dpkg/statoverride

And finally, dpkg should be able to configure these packages without errors.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × 4 =