disgusting linux package installation issues

Was installing a package on Linux and ran into huge problems.

First, the package — let’s call it ‘somecrap’ — contained a post-installation configuration. Linux has this terminal pseudo-GUI used sometimes for configuration of packages. You may have seen it, it looks like ASCII art. Unfortunately it’s so brittle that when you Ctrl-Z out of it there is no way to get it back. So I had to just Ctrl-C out of it. Turns out the process that runs it (‘whiptail’) is stuck using 100% of CPU. So that’s fine, it too can be killed, but how to get a configuration do-over? The package thinks it’s already configured — and indeed, wrote out a default configuration file. There is no way to get a redo short of removing and reinstalling the package. Right? And that’s where the real problem starts.

The package uses ‘dbconfig-common’. When you remove the package, the database modifications are not reverted (understandable), but the database configuration file ‘/etc/dbconfig-common/somecrap.conf’ that was generated by this pseudo-GUI was also not removed. When you remove and reinstall the package, it refuses to reconfigure that file, probably because dbconfig-common thinks everything is already configured! So then I just deleted ‘somecrap.conf’, in the quite natural belief that the package will then rerun the configuration to generate it, like on a fresh install.

Turns out no. Every installation gives

dbconfig-common: writing config to /etc/dbconfig-common/somecrap.conf
Not replacing deleted config file /etc/dbconfig-common/somecrap.conf
unable to read input file /etc/dbconfig-common/somecrap.conf

And the configuration fails. It’s really unbelievable how fatuous ‘dbconfig-common’ is here. Somewhere it’s tracking that ‘somecrap.conf’ is supposed to exist, instead of determining whether it actually does, from the ground truth.

All the ideas about removing, purging packages, reinstalling are not going to help here. The thing that worked was to reinstall dbconfig-common, to get it to fix itself:

apt-get install –reinstall dbconfig-common

debconf then screeches about ‘possible database corruption’ and ‘adding back missing question’ w.r.t. ‘dbconfig-common’. Reinstalling ‘somecrap’ at this point finally brings back the original pseudo-GUI configuration process.


  1. juanma
    January 29th, 2013 | 8:17

    All the ideas about removing, purging packages, reinstalling are not going to help here.

    I ran into the same problem, but with:

    dpkg -P somecrap
    ucfr –purge somecrap /etc/dbconfig-common/somecrap.conf
    ucf –purge somecrap
    sed ‘/somecrap/d’ /var/lib/ucf/hashfile

    I finally solved it without reinstalling dbconfig-common

Leave a reply