12

I have been running Ubuntu 12.04 for the past few weeks. I recently tried to download and install some files through the Update Manager. It located a few files, downloaded them, but then failed to install them. It gave the error:

installArchives() failed: (Reading database ... 
(Reading database ... 80%
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'libasn1-8-heimdal': Input/output error

I tried using apt-get upgrade but a similar error was produced:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  icedtea-6-jre-cacao icedtea-6-jre-jamvm openjdk-6-jre openjdk-6-jre-headless
  openjdk-6-jre-lib
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/34.6 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 80%
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'libasn1-8-heimdal': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

Any help would be greatly appreciated. Thanks in advance.

Edit: Here's some extra information that may be useful. My original problem was that the Ubuntu Software Centre would not open. I found that the Update Manager and Synaptic Package Manager also failed to open. They all gave an error along the lines of:

"installArchives() failed: dpkg: error: reading package info file '/var/lib/dpkg/available': Input/output errorError in function:"

After much googling I seemed to fix that problem as the package managers would open again. When I then tried to download and install any updates from the Update Manager I got the error at the beginning of this post.

4
  • What files have you downloaded? From where? What does the update manager has to do with it? May 19, 2012 at 14:43
  • You might try to uninstal (and later reinstall)l the package in the message. If that fails you might try to clear out the cache. May 19, 2012 at 18:06
  • I am still working on fixing this, I just haven't had the chance yet. I am going to try instructions given here: goo.gl/oOKqG when I have the chance.
    – user64654
    May 21, 2012 at 12:36
  • Why did you choose to install 12.04 and not 14.04? After all, you said you got it a couple of weeks ago, and Trusty has been out for like nine months.
    – John Scott
    Jan 2, 2015 at 18:04

2 Answers 2

18

I have fixed the problem with these instructions.

So the solution is the following:

  1. Go into the /var/lib/dpkg directory
  2. Make a backup of the status file
  3. Edit the status file
  4. Search the package that gave the error
  5. Just delete the lines from this package (but let all other lines that concern other packages even if they contains the broken package in their "Replaces" or "Depends" fields)

    […]

  6. Save changes in the status file

  7. Run: sudo dpkg --configure -a
  8. Force the re-installation of missing dependencies (because now, there are some):

    sudo apt-get -f install
    

    I think that if the broken package does not depend on any other package (could be rare), just reinstall it:

    sudo apt-get install the_package
    
  9. Everything is fine now can update, upgrade, or install new packages!

It should be noted that I had a few differences to the solution given there. The status file was not easy to edit (as it is an important file and never meant to be edited). Any edits made there should be done with care, and the file should be backed up before you make any changes.

I had to repeat steps 4-8 three times (each time the error would be the same just with a different package). Finally when all the packages were removed, I was able to reinstall them, and it fixed my problem.

2
  • How did you find which packages caused the error?
    – Seanny123
    Oct 23, 2016 at 1:08
  • @Seanny123 the prior attempt to apt-get install would presumably be showing the error. For example in my case I have "reading files list for package 'manpages-dev': Input/output error" just before the prompt returned. In the status file, I searched for "Package: manpages-dev" and deleted the lines up to the next "Package:" line. After that I had to do a manual "apt-get install manpages-dev" and then my previously failing "apt-get dist-upgrade" completed without errors. (Thanks user64654!) Dec 20, 2019 at 4:35
2

It can happen that the disk is corrupted with inodes.

With a live CD, run this command

sudo fdisk -l

note the disk and partition, it could be /dev/dsb1 then repair it:

sudo fsck -y /dev/sdb1

Reboot, and return on the system

sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade
1
  • I did the fsck via sudo shutdown -rF now and, without anything further, everything was fine again.
    – Klaws
    Feb 9, 2020 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .