apt-get fails: package index files are corrupted

Bug #105179 reported by vMeson
4
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: apt

This is for feisty...
cat /etc/debian_version
4.0

macleodr@dingus:~$ dpkg -l apt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================-=========================-==================================================================
ii apt 0.6.46.4ubuntu10 Advanced front-end for dpkg

macleodr@dingus:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  at-spi bug-buddy deskbar-applet eog evince evolution evolution-common evolution-data-server evolution-data-server-common
  evolution-exchange evolution-plugins file-roller foomatic-db gnome-accessibility-themes gnome-doc-utils gnome-keyring
  gnome-orca gnome-panel gnome-panel-data gnome-system-monitor gnome-system-tools gnome-themes gnome-user-guide
  gnome-utils gtkhtml3.14 human-icon-theme hwdb-client-common hwdb-client-gnome libatspi1.0-0 libcamel1.2-10 libebook1.2-9
  libecal1.2-7 libedata-book1.2-2 libedata-cal1.2-6 libedataserver1.2-9 libedataserverui1.2-8 libegroupwise1.2-13
  libexchange-storage1.2-3 libgnome-keyring0 libgnome-speech3 libgnomekbd-common libgnomekbd1 libgnomekbdui1
  libgtkhtml3.14-19 libmetacity0 libnautilus-burn4 libpanel-applet2-0 linux-restricted-modules-2.6.20-14-386
  linux-restricted-modules-common metacity metacity-common nautilus-cd-burner openprinting-ppds python-orca-brlapi
  restricted-manager update-notifier usplash-theme-ubuntu vino yelp
59 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
E: The package index files are corrupted. No Filename: field for package human-icon-theme.

macleodr@dingus:~$ dpkg -l human-icon-theme
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================-=========================-==================================================================
ii human-icon-theme 0.15-0ubuntu1 Human Icon theme

This has happened twice now. The first time I "fixed it" by doing
$ sudo dselect update

This time, that command doesn't help.
I did a bunch of googling but this doesn't seem to be a common issue.
Help!

// Randy MacLeod

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

Please attach your /etc/apt/sources.list and /etc/apt/sources.list.d/ files.

Changed in apt:
status: Unconfirmed → Needs Info
Revision history for this message
vMeson (rwmacleod) wrote :
Revision history for this message
vMeson (rwmacleod) wrote :
Revision history for this message
vMeson (rwmacleod) wrote :
Revision history for this message
vMeson (rwmacleod) wrote :

The problem has gone away for now.
Perhaps the apt repository that I'm using isn't being atomically updated?

All I've done is:
sudo apt-get update # serveral times
sudo apt-get check
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

So should the bug get closed or do we wait for a few days to see if the problem comes back?

// Randy

Revision history for this message
vMeson (rwmacleod) wrote :

The problem has returned.

I've cleaned up my sources.list file - see attached.
See log below.

Is this a common problem?

// Randy

macleodr@dingus:~$ sudo apt-get clean
macleodr@dingus:~$ sudo apt-get update
Get:1 http://ca.archive.ubuntu.com feisty Release.gpg [191B]
Get:2 http://ca.archive.ubuntu.com feisty-updates Release.gpg [191B]
Get:3 http://ca.archive.ubuntu.com edgy Release.gpg [191B]
Get:4 http://ca.archive.ubuntu.com edgy-updates Release.gpg [191B]
Hit http://ca.archive.ubuntu.com feisty Release
Hit http://ca.archive.ubuntu.com feisty-updates Release
Hit http://ca.archive.ubuntu.com edgy Release
Hit http://ca.archive.ubuntu.com edgy-updates Release
Hit http://ca.archive.ubuntu.com feisty/main Packages
Hit http://ca.archive.ubuntu.com feisty/restricted Packages
Hit http://ca.archive.ubuntu.com feisty/main Sources
Hit http://ca.archive.ubuntu.com feisty/restricted Sources
Hit http://ca.archive.ubuntu.com feisty/universe Packages
Get:5 http://security.ubuntu.com feisty-security Release.gpg [191B]
Hit http://ca.archive.ubuntu.com feisty/universe Sources
Hit http://ca.archive.ubuntu.com feisty-updates/main Packages
Hit http://ca.archive.ubuntu.com feisty-updates/restricted Packages
Hit http://ca.archive.ubuntu.com feisty-updates/main Sources
Hit http://ca.archive.ubuntu.com feisty-updates/restricted Sources
Hit http://ca.archive.ubuntu.com edgy/universe Packages
Hit http://ca.archive.ubuntu.com edgy-updates/universe Packages
Get:6 http://security.ubuntu.com edgy-security Release.gpg [191B]
Hit http://security.ubuntu.com feisty-security Release
Hit http://security.ubuntu.com edgy-security Release
Hit http://security.ubuntu.com feisty-security/main Packages
Hit http://security.ubuntu.com feisty-security/restricted Packages
Hit http://security.ubuntu.com feisty-security/main Sources
Hit http://security.ubuntu.com feisty-security/restricted Sources
Hit http://security.ubuntu.com edgy-security/universe Packages
Fetched 6B in 1s (5B/s)
Reading package lists... Done

macleodr@dingus:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  base-files doc-debian gnome-panel gnome-panel-data gnome-power-manager hwdb-client-common
  hwdb-client-gnome launchpad-integration liblaunchpad-integration0 liblpint-bonobo0 libnm-glib0 libnm-util0
  libpanel-applet2-0 linux-restricted-modules-2.6.20-14-386 linux-restricted-modules-common network-manager
  network-manager-gnome python-launchpad-integration restricted-manager
19 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
E: The package index files are corrupted. No Filename: field for package doc-debian.
macleodr@dingus:~$ date
Thu Apr 12 09:57:17 EDT 2007

Revision history for this message
vMeson (rwmacleod) wrote :

Here's a work around.
Let's say you try to apt-get upgrade and get the error message:
E: The package index files are corrupted. No Filename: field for package doc-debian.

Just,
sudo apt-get remove doc-debian
sudo apt-get upgrade

Not the upgrade works but

sudo apt-get install doc-debian
...
E: The package index files are corrupted. No Filename: field for package doc-debian.

still fails.

Is this new to anyone?

// Randy

Revision history for this message
Nils Adermann (naderman) wrote :

I've had the same problem and was able to solve it by removing all files in /var/lib/apt then running aptitude update and aptitude dist-upgrade and then the error was gone.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for apt (Ubuntu) because there has been no activity for 60 days.]

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.