Wednesday, March 17, 2010

Sub-process /usr/bin/dpkg returned an error code

Error:
files list file for package `linux-image-2.6.24-19-generic' is missing final newline
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-2.6.24-19-generic_2.6.24-19.36_i386.deb
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fix:
https://lists.ubuntu.com/archives/ubuntu-users/2007-January/104520.html

# move the info dir containing corrupted data out of the
# way, and create a new 'info' dir
cd /var/lib/dpkg
sudo mv info info.bak
sudo mkdir info

# reinstall the affected package, in my case this was
sudo apt-get --reinstall install libgtk1.2

# this will print lots of warnings about missing list
# files for the dependencies, which is obvious.
# now move the newly generated files in 'info/' to the
# 'info.bak/' directory containing info for all packages
# this will replace the information for the package
# we just installed
sudo mv info/* info.bak/

# and now get things back to where they were
sudo rm -rf info

No comments: