One of the most common error a user encounters while updating is Problem with MergeList. The error could be encountered while using both Ubuntu Update Manager and using the sudo apt-get update in terminal.
The complete error looks something like this:
E:Encountered a section with no Package: header,
E:Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages,
E:The package lists or status file could not be parsed or opened.
It’s the second line that is important here. It tells you that the mentioned file in the second line got corrupted some how and so it cannot be parsed.
Fixing MergeList problem in Ubuntu
The one shot solution of this problem is to run the following two commands, one by one, in the terminal (Ctrl+Alt+T):
sudo rm -r /var/lib/apt/lists/*
You can generate a fresh one with this command:
sudo apt-get clean && sudo apt-get update
Voila! That should solve the “problem with merge list” error.
Fixing MergeList problem in Debian and Raspbian OS
If you use Debian or Raspbian OS or even Ubuntu, you may see the MergeList error but the corrupted files may be different:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
This time, the issue is with /var/lib/dpkg/status. Handling this error is slightly different and slightly more complicated than the previous one.
Now, you could but you shouldn’t just delete it straightaway. Make a backup first:
mv /var/lib/dpkg/status /var/lib/dpkg/status.old
What you need to do now is to get a backup of this status file and use it. The backup files are stored in /var/backups directory. You can list it out:
ls -l /var/backups/dpkg.status*
Copy the latest backup:
cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
Try to run update now and see if the problem is fixed. If not, you can try with the next backup file. If the file is archived, you need to unzip it first. Once copied, run the update command again and check if it’s fixed.
In other frequent Ubuntu update errors, one is Failed to download repository information. You may want to check them as well. Enjoy Ubuntu :)