So i was playing around on my Ubuntu 11.04 PC last night when I decided to do an upgrade, make sure everythings up to date etc before my next project.

When I tried an “apt-get upgrade”, I got the following errors:

root@skynewuntu:/# apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages have been kept back:
lib32asound2 libc6-i386
The following packages will be upgraded:
bind9-host dnsutils gnome-nettool libbind9-60 libdns69 libisc62 libisccc60 libisccfg62 liblwres60 libpam-modules libpam-modules-bin libpam-runtime libpam0g xserver-common xserver-xephyr xserver-xorg-core
16 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 0 B/4,414 kB of archives.
After this operation, 8,192 B of additional disk space will be used.
Do you want to continue [Y/n]?
Preconfiguring packages …
(Reading database …
dpkg: warning: files list file for package `libqt4-help’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `sessioninstaller’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `ghostscript-x’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `uno-libs3′ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `ttf-wqy-microhei’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `e2fslibs’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libqapt-runtime’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `gedit-plugins’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libgimp2.0′ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libfile-basedir-perl’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `mozilla-plugin-gnash’ missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `man-db’ missing, assuming package has no files currently installed.
(Reading database … 95%dpkg: unrecoverable fatal error, aborting:
files list file for package ‘libpam-modules-bin’ is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
First, I checked my file system with a “touch /forcefsck && shutdown -r now”, but this found nothing. I then double checked /etc/apt/sources.list for corruptions etc. Nothing there either.
I did some googling and came up pretty much empty apart from this link here: linky
So i did as it said, and went into /var/lib/dpkg/info. I then did a “ls -la | grep e2fslibs” and saw the following:
root@skynewuntu:/var/lib/dpkg/info# ls -la | grep e2fslibs
-rw-r–r– 1 root root     285 2011-03-17 18:09 e2fslibs:amd64.md5sums
-rwxr-xr-x 1 root root     135 2011-03-17 18:09 e2fslibs:amd64.postinst
-rwxr-xr-x 1 root root     132 2011-03-17 18:09 e2fslibs:amd64.postrm
-rw-r–r– 1 root root      39 2011-03-17 18:09 e2fslibs:amd64.shlibs
-rw-r–r– 1 root root   13022 2011-03-17 18:09 e2fslibs:amd64.symbols
I compared this with a working file, “GCC-4.5” output:
-rw-r–r– 1 root root     550 2011-05-06 08:39 gcc-4.5-base:amd64.list
-rw-r–r– 1 root root     384 2011-04-18 15:22 gcc-4.5-base:amd64.md5sums
-rw-r–r– 1 root root    5211 2011-05-06 08:45 gcc-4.5.list
-rw-r–r– 1 root root    6589 2011-04-18 15:27 gcc-4.5.md5sums
And noticed that in our e2fslibs output we are missing a .list file. So i tried it; “touch e2fslibs:amd64.list && apt-get upgrade”.
Sure enough – it passed and e2fslibs was no longer in the list. I did this for all the files in the list, did an “apt-get upgrade” again and voila, it updated and fixed the broken files i’d bodged a list into 🙂
HTH,
Sam