Sunday, April 2, 2017

14.04 - apt-get install fails due to empty /var/lib/dpkg/diversions

I've got a freshly installed trusty installation, where I have so far done the following:





  1. Installed

  2. Run sudo apt-get update && sudo apt-get dist-upgrade (and ran the update)



After a reboot (though I'm unsure of when exactly it broke, I've rebooted a few times now since then), now I'm unable to install anything via apt. Attempting to install gives:



mitch@corundum:/media$ sudo apt-get install htop
Reading package lists... Done
Building dependency tree
Reading state information... Done

The following NEW packages will be installed:
htop
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/68.0 kB of archives.
After this operation, 188 kB of additional disk space will be used.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 1.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
dpkg: unrecoverable fatal error, aborting:
fgets gave an empty string from `/var/lib/dpkg/diversions'
E: Sub-process /usr/bin/dpkg returned an error code (2)



I've searched for the penultimate line and found a few links, but none of them helped.



For example, this question runs a python script as the most upvoted answer - tried that, but it's no good.



Both the files at /var/lib/dpkg/diversions and /var/lib/dpkg/diversions-old are empty - thus, replacing the current with the old doesn't do anything.



How do I get this to install?

No comments:

Post a Comment

11.10 - Can&#39;t boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...