Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The computer gave me this output in a window:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

How can I fix this?

share|improve this question

6 Answers

up vote 68 down vote accepted

These terminal commands should solve your problem:

First remove the Merge List by opening a terminal (Hit Ctrl-Alt-T to launch) and running this command

sudo rm /var/lib/apt/lists/* -vf

Next generate a new one by running a simple update

sudo apt-get update

Here is the bug report (and another) for this problem, which is now fixed so it shouldn't create new malformed files, however if you already have the malformed files you need to remove them as explained in this post.

share|improve this answer
1  
One individual found he had to do these two steps multiple times, but that it worked eventually. – John S Gruber Sep 9 '12 at 5:24
This also works for error Reading package lists... Error! E: Malformed Description-md5 line; includes invalid character 'fc1f7600accbcc"07ef9954ba3306c14' E: The package lists or status file could not be parsed or opened. in out-of-the-box Ubuntu 13.04 (sources.list never edited manually) – Nicolas Raoul May 15 at 1:10

Open a Terminal and run the following commands one at a time:

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

See also:

share|improve this answer
what does the -vf do? – speedox Feb 2 at 15:42
@speedox, according to man rm, -v means 'verbose', and -f means 'force'. In other words, remove all designated files without prompting and tell the user what it is doing. – InkBlend Apr 10 at 0:21

You screwed up when you edited /var/lib/dpkg/status. Restore it from the backup that you made before editing it. Of course, you made a backup, right?

Since you didn't make a backup, edit it again, carefully. Try not to cause more damage.

You can use /var/lib/dpkg/status.old as a reference point. This is a backup of the status file from before the last time dpkg was run. Run

diff /var/lib/dpkg/status.old /var/lib/dpkg/status

to see the differences. Undo the changes that you made manually, and keep the changes that were made by the last dpkg run.

If you really can't manage to repair the file, copy /var/lib/dpkg/status.old over /var/lib/dpkg/status. You will get a well-formed, but out-of-date package database.

You never need to edit /var/lib/dpkg/status in normal operation. Even whe things go seriously wrong, /var/lib/dpkg/status is not something that tends to require administrator intervention. Whatever your problems with crossplatformui were, there is probably a better way of solving them. The only time I've ever needed to edit /var/lib/dpkg/status was when an upstream Packages file was broken.

share|improve this answer
I would also like to know the better way you mentioned to remove crossplatformui if you could help coz i tried every possible way to remove it and tried finding many solutions but only the one i've mentioned has worked... – Nirmik May 13 '12 at 15:58
@Nirmik No idea about crossplatformui. Ask that as a separate question. I can tell you that in over a decade of using dpkg, including many unofficial sources, I've very very rarely needed to edit the status file, and only when there was a broken third-party repository. – Gilles May 13 '12 at 16:01
Okay...Thanx a lot once again....as you suggest i'll post it as a new question :) also as you seem a very advanced user i would like to ask you if you know anything about making non functioning HOT-KTEYS work?? (my wireless key doesent work) – Nirmik May 13 '12 at 16:08

Following steps 2-4 in the Package Manager Troubleshooting Procedure usually solves this problem.

share|improve this answer

I have also seen this problem occur when you have too many sources in your repos.

Try the solution posted above and/or also perhaps this which is sometimes recommended on launchpad:

sudo mv /var/lib/apt/lists /var/lib/apt/lists-old
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update

Let us know how you get on.

share|improve this answer

I did

sudo apt-get clean
sudo apt-get update

and it worked.

share|improve this answer

protected by Community Oct 17 '12 at 9:32

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.