48

Everytime I sudo apt-get update it always not complete and will say in the end

E: Read error - read (5: Input/output error)
E: The package lists or status file could not be parsed or opened.

Same goes, when I try to install something and do sudo apt-get install <some app>

What should I do ? I admit, that my drive has bad sectors, could that be the reason? Is there anything else I can do?

2
  • I am experiencing the same problem,even though i followed solution provided by Avinash Raj the error recurrs. is there any other way to approach this problem. thanks in advace
    – saikumarm
    May 9, 2014 at 12:06
  • Could it be HDD problems? I have been having the same problems and my file system kept on falling back to a read-only system. Jun 29, 2015 at 7:57

4 Answers 4

48

This is old question, but just for archive purpose... the follow was what solve this problem in my case:

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get update
4
  • 2
    yes removing all the apt-get files and starting totally fresh was also what worked for me, it took some time but worked! tanx
    – azerafati
    May 14, 2016 at 14:28
  • 1
    This worked for me after the 3 other options - copy old status / copy backup status / delete and create blank status - didn't work. I also realized how the problem occurred. I had tried changing servers during my last manual update (in June 2016), while the issue was actually with my ISP, which hung the operation couple of times. The lists folder had (possibly corrupted) lists from different Ubuntu servers, which got cleared and recreated after this operation.
    – Sri
    Jul 14, 2016 at 5:48
  • 2
    This also worked for me, also see How do I fix a "Problem with MergeList" or "status file could not be parsed" error when trying to do an update? for more details & instructions. Sep 4, 2016 at 9:36
  • 1
    I just needed to do the last two steps of this.
    – BananaNeil
    Nov 19, 2016 at 0:17
42

Try using an older status file,

sudo mv /var/lib/dpkg/status /var/lib/dpkg/status.bad
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo apt-get update
7
  • 1
    thank you 2x Avinash :) .. that really saves me.. All along it was just the status file is my problem? Jan 24, 2014 at 13:58
  • 2
    The problem persists even after doing the steps you told, may be my status-old is also corrupt.
    – Prabhu
    Aug 24, 2014 at 8:35
  • the try the one within the backup directory /var/backups/dpkg.status.0 Aug 24, 2014 at 8:39
  • 4
    In my case, this did not work. I removed /var/lib/dpkg/status and just created an empty one with touch /var/lib/dpkg/status and that fixed the problem.
    – hayavuk
    Sep 2, 2014 at 16:43
  • 2
    I had to do the following to solve this: sudo rm /var/lib/apt/lists/* -vf sudo apt-get update
    – aVeRTRAC
    Dec 30, 2014 at 4:43
8

I was running into a similar error:

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.

I followed similar suggestions to copy status-old.

$ head /var/lib/dpkg/status
$ head /var/lib/dpkg/status-old

All of my status files were blank for some reason. Luckily, I found out there are backups of these files:

$ ls -l /var/backups/dpkg.status.*
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.0
-rw-r--r-- 1 root root 444620 Nov 15 06:33 /var/backups/dpkg.status.1.gz
-rw-r--r-- 1 root root 128168 Sep 20  2013 /var/backups/dpkg.status.2.gz
-rw-r--r-- 1 root root 112545 Sep 16  2013 /var/backups/dpkg.status.3.gz
-rw-r--r-- 1 root root 107767 Sep 14  2013 /var/backups/dpkg.status.4.gz
-rw-r--r-- 1 root root 107766 Sep 11  2013 /var/backups/dpkg.status.5.gz
-rw-r--r-- 1 root root  94583 Sep 11  2013 /var/backups/dpkg.status.6.gz

I checked the latest backup...

$ head /var/backups/dpkg.status.0

...but it was still blank. So I unzipped an older one...

$ gunzip /var/backups/dpkg.status.1.gz
$ head /var/backups/dpkg.status.1

This time there was content. So I copied it...

$ cp /var/backups/dpkg.status.1 /var/lib/dpkg/status

Then apt-get update ran without problems.

Credit goes to this post.

0

I had a similar error, but the problem was not in dpkg.status, but in an apt listing.

To check the likely cause, run strace -efile apt install something. Then look for the last files accessed before the error message shows:

stat("/var/lib/apt/lists/linux.dropbox.com_ubuntu_dists_xenial_main_i18n_Translation-en%5fUS.uncompressed", 0x7fffd2f39d00) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/linux.dropbox.com_ubuntu_dists_xenial_main_i18n_Translation-en%5fUS", 0x7fffd2f39e50) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_InRelease", 0x7fffd2f39d10) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_Release", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_InRelease", 0x7fffd2f396d0) = -1 ENOENT (No such file or directory)
stat("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_Release", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=57344, ...}) = 0
open("/tmp/fileutl.message.XlglFW", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/tmp/fileutl.message.XlglFW")   = 0
open("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_Release", O_RDONLY) = 6
open("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_Release", O_RDONLY) = 5
stat("/var/lib/apt/lists/www.fossology.org_releases_2.6.2_Ubuntu_dists_14.04_Release", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
Reading package lists... Done
E: The package lists or status file could not be parsed or opened.
+++ exited with 100 +++

In my case, the last file (a Release file from fossology) turned out to be 0 bytes long. Removing that repository enabled apt to resume normal functionality

Not the answer you're looking for? Browse other questions tagged or ask your own question.