20

I had an application installed on my htpc running ubuntu server called mediatomb, a few months ago I uninstalled it and replaced it with a Plex install. At the weekend when querying existing users on the machine I noticed that the mediatomb user and group still existed so I used the command

sudo deluser mediatomb

to remove the user. A day or so later I went to install htop sudo apt-get install htop but I found that I was getting an error:

syntax error: unknown user 'mediatomb' in statoverride file.

I thought I would just be able to open the statoverride file using nano and edit out any references to mediatomb but I wasn't able to open the file correctly using nano. I ran a grep command

grep 'mediatomb' /var/lib/dpkg/statoverride

which returned two locations in the file which don't exist on the system anymore. The only way I am able to get around the issue for now is to re-create the user mediatomb and then everything works fine. Obviously this isn't a good long-term solution.

What I would like to know is, what is the statoverride file and why does it retain users in it which have been removed from the system? Am I removing the users in the wrong or deprecated way?

45

I know this question is a little old, but have come across this twice now. Once with puppet, once with virtualbox. It cropped up again and I found something that worked. It's a variation on serverfault.com.

Instead of relying on dpkg-statoverride --remove /path/to/offending/file.ext which, throws the error

dpkg: unrecoverable fatal error, aborting:
syntax error: unknown group offendinggroup in statoverride file

You can get fancy with sed, or you can simply open /var/lib/dpkg/statoverride in your favorite text editor and remove only the lines containing the item(s) that were causing the error. I found that this is a documented bug, for both Debian, and Ubuntu,

That said, I just fixed mine by manually editing out any entry that threw an error, and I am happily downloading packages again. Hope this helps the next person, who visits this number 1 Google search result for this problem.

  • Thank you so much! I was just beginning to be worried that I will be spending all of eternity discovering obscure corners of linux world in order to resolve this simple cockup i'd made some days ago. don't know how i managed to do this, but removing that one line from that file fixed the problem. thanks so much for saving me a lot of time! – Peter Perháč Oct 30 '16 at 21:08
  • You are awesome! Fixed my issue. – Elad Weiss Feb 20 at 13:28
16

While I can't answer your question as asked I can help you with your dilemma. I experienced the exact same problem you are having after using 'User Accounts' to remove user 'backuppc' - a user I manually configured for backups. Well I scrapped that route but didn't try to remove the user until a couple weeks later (IE - today). I hadn't been experiencing any trouble until Update Manager found and tried to apply updates; the process would fail reading

dpkg: unrecoverable fatal error, aborting:  
 syntax error: unknown user 'backuppc' in statoverride file
W: Waited for dpkg --assert-multi-arch but it wasn't there - dpkgGo (10: No child processes)
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install.  Trying to recover:

After some searching I found a solution.

x@y ~ $ 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
backuppc www-data 4750 /usr/lib/backuppc/cgi-bin/index.cgi
root ssl-cert 710 /etc/ssl/private
root crontab 2755 /usr/bin/crontab

Fixed by running: sudo sed -i '/backuppc/d' /var/lib/dpkg/statoverride

x@y ~ $ sudo sed -i '/backuppc/d' /var/lib/dpkg/statoverride; cat /var/lib/dpkg/statoverride
[sudo] password for x: 
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

Sorry I'm not able to answer your question, but this was the second result in google so I wanted to put a solution here for people. My answer originated from http://rickfoosusa.blogspot.com/2012/04/howto-ubuntu-unknown-user-in.html.

  • 3
    This is the worst approach to the problem. You should instead reinstall/reconfigure the package instead of going around deleting things that are not meant to be deleted. – Braiam Oct 11 '14 at 0:30
4

I was getting following error:

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

Below command solved my apt-get install problem

sudo sed -i '/crontab/d' /var/lib/dpkg/statoverride

You can change the crontab word but keep the '/d' until you can successfully install any apt-get without any syntax error.

root@localhost:~# sudo sed -i '/messagebus/d' /var/lib/dpkg/statoverride
root@localhost:~# apt-get install wifite
Reading package lists... Done
2

It is because you may have deleted the user and now dpkg queries /etc/passwd to compare with the statoverride file, it checks that all entries of the statoverride file are in the passwd, and if they are not, issue a warning, which is what is happening.

That is easily fixable if you reconfigure/reinstall the relevant package (in your case it was mediatomb, it can be anything else, luckily Debian (the OS Ubuntu is based on) uses the same username as the name of the project, normally) and it will (re)create the user in the passwd file.

sudo apt-get --reinstall install package

or

sudo dpkg-reconfigure package
1

When I installed DelugeD, it created a user called debian-deluged. Later on, I changed Deluge config to use another user ID and I removed the auto-created user. This resulted in the statoverride error when installing the package speedometer.

I launched sudo nano /var/lib/dpkg/statoverride and manually replaced the auto-created user with the assigned user-ID and the error was resolved.

0

I had a similar error and fixed it by first backing up the statoverride file and then removing all the lines containing the word postdrop.

Remember to add a new line at the end of statoverride file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.