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)
-------------------------------------
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:
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: ------- ------- ------- ------- -- es.archive. ubuntu. com lucid-updates/ universe Sources [37,0kB]
-------
Get:10 http://
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:
------- ------- ------- ------- ------- -- es.archive. ubuntu. com lucid-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <email address hidden> es.archive. ubuntu. com/ubuntu/ dists/lucid- updates/ universe/ source/ Sources. bz2 Sub-process /bin/bzip2 returned an error code (2)
W: GPG error: http://
W: Failed to fetch http://
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 apt/lists/ es.archive. ubuntu. com_ubuntu_ dists_lucid- updates_ restricted_ binary- amd64_Packages
sudo rm /var/lib/
After this both apt and update manager work.