August 5, 2010

Solving Error "E: Sub-process /usr/bin/dpkg returned an error code (2)" In Ubuntu 10.04

I noticed that suddenly my Synaptic and apt-get weren't installing any package on my new Ubuntu 10.04. On looking at the details, I found the following error being flashed:

dpkg: unrecoverable fatal error, aborting:
statoverride statoverride unknown group gnokii
E: Sub-process /usr/bin/dpkg returned an error code (2)


I Googled and found the following two links:

1. http://ubuntuforums.org/showthread.php?t=508679

2. http://ubuntuforums.org/archive/index.php/t-329560.html

From the two links above, I knew I had to see or even edit my /var/lib/dpkg/statoverride file.

It contained:

root mlocate 2755 /usr/bin/mlocate
hplip root 755 /var/run/hplip
root gnokii 4750 /usr/sbin/mgnokiidev


I deleted the last line "root gnokii 4750 /usr/sbin/mgnokiidev". But it gave a similar error:

dpkg: unrecoverable fatal error, aborting:
statoverride file contains empty line
E: Sub-process /usr/bin/dpkg returned an error code (2)


This was shocking as the file isn't empty.

Then, I realized that my cursor was on an empty line. Doing a backspace and bringing it to the last non-empty line solved the problem, irrespective of the line "root gnokii 4750 /usr/sbin/mgnokiidev" being present in the file.

It wasn't a serious problem anyways.



6 comments:

  1. unrecoverable fatal error, aborting:
    files list file for package `com.ansonworks.flightbriefer' contains empty filename
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    A package failed to install. Trying to recover:

    can you help gyromehta@hotmail.com

    ReplyDelete
  2. http://www.bleepingcomputer.com/forums/lofiversion/index.php/t295396.html

    it was solved by above link

    sorry to bother

    gyromehta@hotmail.com

    ReplyDelete
  3. Open your /var/lib/dpkg/statoverride file. See if any line is empty (I have already written about that, read above). If necessary, do a backspace to bring your cursor to the last non-empty line.

    ReplyDelete
  4. Thanks for your post. I'm actually looking for this. Your post solved my problem.

    ReplyDelete
  5. sudo apt-get clean
    sudo apt-get autoremove
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get -f install

    ReplyDelete