Monday, November 26, 2012

dpkg: Input/output error

This error is usually not hardware-wise (some say your hard disk has bad blocks). Actually, the dpkg database (/var/lib/dpkg/status) is not remembering things well. This leads package management to fail in any case, automatic repairs don't work.
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'emacs23-common': Input/output error
Due to an archive post by gartss (Refer link), it is repairable by manually removing the error-causing package records in status file.
Here is the sketch.
cd /var/lib/dpkg
sudo cp status status.backup
sudo vi status //remove the error package records (not those of dependencies)
sudo dpkg --configure -a
sudo apt-get -f install

1 comment:

  1. Thank you for this post, it really helped me out!

    ReplyDelete