Package list corruption

Asked by Olivier Mengué

I upgraded from maverick to natty less than one hour ago.

After the upgrade, network-manager selected the wrong Wifi network: an open network which is protected with a web login page (but I didn't notice that).

I launched update-manager to ensure that all updates where installed.
The update dowload failed and update-manager reported a failure dialog (the text is not selectable for copy/paste, great UI!) saying that some file is corrupted ("no Package header").

Now my local package list is corrupted:
- update-manager: fails at startup with the same dialog as above
- ubuntu-bug fails: can't determinate the package name
- sudo apt-get-update fails:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

When looking at /var/lib/apt/lists/fr.archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages, it contains the three bytes: "OK\n"

http://fr.archive.ubuntu.com/ubuntu/dists/natty/main/binary-i386/ seems OK

http://fr.archive.ubuntu.com/ubuntu/

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mengué (dolmen) said :
#1

I had to manually cleanup the 3 bytes files:

    cd /var/lib/apt/lists
    perl -E 'map { say } grep { (stat)[7]==3 } glob("*")' | xargs sudo rm
    sudo apt-get update

However, I don't think that is the kind of things that the average Ubuntu user is expected to do.

*******************
apt-get should be more resilient to network connectivity problems.
*******************

Revision history for this message
Alex Nikolaenko (ceekay80) said :
#2

To me help this command:

# rm rf /var/lib/apt/lists/*

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#3

@Olivier: I fully agree.

Around a year ago, I created the following workaround procedure while waiting for apt-get to get fixed:

https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure

Can you help with this problem?

Provide an answer of your own, or ask Olivier Mengué for more information if necessary.

To post a message you must log in.