5

Server running Ubuntu 12.04 lts

I installed munin the other day on a server. I decided later to remove it with apt-get.

I noticed that not everything was removed from the installation so manually removed the munin web directory and also removed the munin user-name and group from the sever.

However I have just now tried to run apt-get upgrade which is now returning an error:

dpkg: unrecoverable fatal error, aborting: syntax error: unknown user 'munin' in statoverride file E: Sub-process /usr/bin/dpkg returned an error code (2)

I am now out of my depth. What does this mean? Google results have not really been helpful.

Can anyone help?

Thanks, John

John
  • 877
  • 4
  • 15
  • 25

3 Answers3

8

Take a look in

/var/lib/dpkg/statoverride

if there is any line

root munin 750 /etc/munin/plugin-conf.d

Try:

dpkg-statoverride --remove /etc/munin/plugin-conf.d
Alex
  • 334
  • 1
  • 7
  • There are quite a few: munin munin 755 /var/lib/munin root mlocate 2755 /usr/bin/mlocate root munin 750 /etc/munin/plugin-conf.d munin munin 755 /var/cache/munin/www root ssl-cert 710 /etc/ssl/private munin adm 750 /var/log/munin root crontab 2755 /usr/bin/crontab Do i just remove all the munin related ones i am guessing? – John Oct 27 '13 at 19:57
  • Remove only the munin related ones – Alex Oct 27 '13 at 20:05
2

I noticed that not everything was removed from the installation so manually removed the munin web directory and also removed the munin user-name and group from the sever.

Don't do that! Because you didn't purged properly the users stored in /etc/passwd file, which dpkg queries to compare with the statoverride file, do not match up and dpkg is throwing a warning. Instead purge the package and dpkg will remove all the directories and users the package created, without the user having to dirt their hands in it.

sudo apt-get purge package

This should do it.

Braiam
  • 622
  • 4
  • 23
  • For those Googling this, this answer is correct in that you should not manually delete package-created users/groups **in the future**. However, Alex's answer seems to work if you have made this mistake. – timelmer Jan 26 '18 at 17:59
0

I was trying to reinstall apache2 cause for some reason which I could not fix, it refused to start

$ sudo apt-get install apache2 dpkg: unrecoverable fatal error, aborting: syntax error:unknown group 'nagios' in statoverride file

Looking into: dpkg/statoverride

cat /var/lib/dpkg/statoverride root postdrop 2555 /usr/sbin/postdrop root postdrop 2555 /usr/sbin/postqueue root mlocate 2755 /usr/bin/mlocate postfix postdrop 2710 /var/spool/postfix/public root nagios 4750 /check_icmp root ssl-cert 710 /etc/ssl/private root crontab 2755 /usr/bin/crontab

The solution was to:
:/etc/php5/apache2/conf.d$ sudo sed -i '/nagios/d' /var/lib/dpkg/statoverride

And the result
:/etc/php5/apache2/conf.d$ cat /var/lib/dpkg/statoverride root postdrop 2555 /usr/sbin/postdrop root postdrop 2555 /usr/sbin/postqueue root mlocate 2755 /usr/bin/mlocate postfix postdrop 2710 /var/spool/postfix/public root ssl-cert 710 /etc/ssl/private root crontab 2755 /usr/bin/crontab

credit: Ubuntu unknown user in statoverride

Jadeye
  • 123
  • 7