Problema de apt: Input/output error

2018/11/14

Al intentar instalar un paquete en Ubuntu 14.04 se obtiene el siguiente problema con apt-get:

$ sudo apt-get install -V firefox-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
   firefox-dbg (50.1.0+build2-0ubuntu0.14.04.1)
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/245 MB of archives.
After this operation, 893 MB of additional disk space will be used.
Selecting previously unselected package firefox-dbg.
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'libavcodec54:i386': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

Alcanza con seguir las indicaciones en https://ubuntuforums.org/showthread.php?t=1232143&p=10010092#post10010092 para reinstalar el paquete y corregir el problema:

  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 reinstallation of missing dependencies (because now, there are some): sudo apt-get --fix-broken install Reinstall the package whose info was deleted: sudo apt-get install -V the_package
  9. Everything is fine now can update, upgrade, or install new packages!

NOTA: se intentó determinar la diferencia ente el backup realizado al archivo status y el archivo luego de reinstalado el programa, pero no se encontraron diferencias. De ahí que se duda de la causa del problema expuesta en el foro:

it is related with a certain package which info is corrupted in the dpkg database