[Bug 108189] Re: files list file for package `*' is missing final newline

Aaron C. de Bruyn aaron at heyaaron.com
Thu May 26 15:42:00 UTC 2011


I am running into this fairly regularly on systems I have deployed for
customers.  The only thing in common with the systems is that they have
the root partition on an SSD.  All of these systems are using the
'KINGSTON SS100S2' SSD.  I get no errors about disk problems in dmesg,
but if I 'touch /forcefsck && shutdown -r now', the box will reboot and
usually find filesystem corruption.

Out of roughly 45 machines there are 10 with SSDs.  9 of the SSD
machines have suffered from this issue.  My resolution was to delete
/var/lib/dpkg/info/<package>.list and re-run 'apt-get update && apt-get
upgrade'.  None of the non-SSD machines have run into this issue.
Lastly, the SSD machines are a mix of 10.04 and 10.10.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dpkg in Ubuntu.
https://bugs.launchpad.net/bugs/108189

Title:
  files list file for package `*' is missing final newline

Status in “dpkg” package in Ubuntu:
  Triaged

Bug description:
  APt-get, adept, and the restricted drivers manager might halt
  installing packages when one or more of the files in:

  /var/lib/dpkg/info/

  is corrupt.

  The error shown will be either:
  files list file for package `*' is missing final newline
  Or:
  files list file for package `*' contains an empty filename

  Where * start is a random but steady "per install" package name.

  Adding a newline char to the file changes the message form the first
  to the seccond error noting about the empty filename.

  Since all these files seem to contain only a string of @^@^@^@^@^@^@^@^@^@^@^@^
  it seems they are redundant, and i ventured on moving them from the folder, this solved the problem.

  Two things need to be resolved here i guess,
  1: dpkg should handle these files more gracefully, there's an abundance of forum posts and related bugs available from people who have no clue where to search, deleting them seems to work, so why not delete them when dpkg encounters this error.
  2: Since all these files essentially contain the same data, why are they even here, there's 4200 of them in a default feisty install, the installer works fine without, so why are they here?

  .:: WORKAROUND ::.
  The reference is http://ubuntuforums.org/showpost.php?p=2635193&postcount=12 . I've rewritten some part of the post to adapt it to Ubuntu.

  There is an easy way to fix this problem without having those serious
  warnings. I did it and it worked out fine. I found the solution in the
  following web site: http://finkproject.org/faq/usage-fink.php

  I'll just copy it here:

  Quote:
  I can't install or remove anything, because of a problem with a "files list file".

  A: Typically these errors take the form:

  Quote:
  files list file for package packagename contains empty filename
  or

  Quote:
  files list file for package packagename is missing final newline
  This can be fixed, with a little work. If you have the .deb file for the offending package currently available on your system, then check its integrity by running

  Quote:
  dpkg --contents full-path-to-debfile

  e.g.

  Quote:
  dpkg --contents /var/cache/apt/archive/libgnome2-0_2.24.1-0ubuntu3_i386.deb
  If you get back a listing of directories and files, then your .deb is OK. If the output is something other than directories and files, or if you don't have the .deb file, you can still proceed because the error doesn't interfere with builds.

  If you have been installing from the binary distribution or you know
  for sure that the version in the binary distribution is the same as
  what you have installed (e.g. by checking the package database), then
  you can get a .deb file by running sudo apt-get install --reinstall
  --download-only packagename .

  Once you have a valid .deb file, then you can reconstitute the file.
  First become root by using sudo -s (enter your administrative user
  password if necessary), and then use the following command:

  Quote:
  dpkg -c full-path-to-debfile | awk '{if ($6 == "./"){ print "/."; } \
  else if (substr($6, length($6), 1) == "/")\
  {print substr($6, 2, length($6) - 2); } \
  else { print substr($6, 2, length($6) - 1);}}'\
  > /sw/var/lib/dpkg/info/packagename.list
  e.g.

  Quote:
  dpkg -c /var/cache/apt/archive/libgnome2-0_2.24.1-0ubuntu3_i386.deb | awk \
  '{if ($6 == "./") { print "/."; } \
  else if (substr($6, length($6), 1) == "/") \
  {print substr($6, 2, length($6) - 2); } \
  else { print substr($6, 2, length($6) - 1);}}' \
  >  /var/lib/dpkg/info/libgnome2-0.list
  What this does is to extract the contents of the .deb file, remove everything but the filenames, and write these to the .list file.

  I hope that helps.




More information about the foundations-bugs mailing list