Comment 10 for bug 105179

Revision history for this message
Alberto González Palomo (matmota) wrote :

I just had this problem. In my case, the exact error message was "E: The package index files are corrupted. No Filename: field for package tzdata.".
I found a solution. Details follow.

Previous to that, I got the following problems:
-------------------------------------
Get:10 http://es.archive.ubuntu.com lucid-updates/universe Sources [37,0kB]
99% [10 Sources bzip2 0B] [Waiting for headers]
bzip2: Data integrity error when decompressing.
 Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Err http://es.archive.ubuntu.com lucid-updates/universe Sources
  Sub-process /bin/bzip2 returned an error code (2)
-------------------------------------

and:

-------------------------------------
W: GPG error: http://es.archive.ubuntu.com lucid-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <email address hidden>
W: Failed to fetch http://es.archive.ubuntu.com/ubuntu/dists/lucid-updates/universe/source/Sources.bz2 Sub-process /bin/bzip2 returned an error code (2)

E: Some index files failed to download, they have been ignored, or old ones used instead.
-------------------------------------

It seems that the package index file gets truncated.
Trying to use the update manager fails silently when I click on "install updates".

The way I found to solve it is first find the truncated files:

egrep 'Package: tzdata|Filename: .*tzdata' /var/lib/apt/lists/ -r

This will list both a "Package:" line and a "Filename:" line if the file is correct.
Replace "tzdata" with whatever package name you get in the error message.

Then I removed those files that only have the "Package:" line.
In my case, those were:

sudo rm /var/lib/apt/lists/es.archive.ubuntu.com_ubuntu_dists_lucid_main_source_Sources
sudo rm /var/lib/apt/lists/es.archive.ubuntu.com_ubuntu_dists_lucid-updates_restricted_binary-amd64_Packages

After this both apt and update manager work.