Ingvaldur Sigurjonsson wrote: > My managed to bring my system to a rather unstable state (I'm running > Debian GNU/Linux testing/unstable...). > > I think I lost the contents of config.dat, I only had 4 blocks (entries) > in it when I discovered it, and I've had problems installing/updating > programs.
Do you know how this happened? Did you have any craches or power failures or the like while dpkg or debconf was running? > My question is: > Is there a way to rebuild the config.dat from what is installed ? Since the file is really just a cache of how you answered various questions, you will have little difficulty if you just delete it. If you do, be sure to delete templates.dat too, as the files are paired. This will result in you having to answer some questions you've already seen before, during upgrades, perhaps, but that's hardly the end of the world. Of course more sophisticated recoveries can be done. The main problem you're seeing is probably that due to the file corruption you experienced and the manual edits, config.dat is inconsistent with templates.dat now, and one or the other file has entries that don't match the other file. Debconf includes a program called check_db.pl (in the source package only) that can aid doing that. For example, running it on the files you enclosed, I get: [EMAIL PROTECTED]:~/debian/packages/debconf>./check_db.pl Warning: question "apt-setup/cd/bad" has no template field. Warning: question "apt-setup/badedit" has no template field. Warning: question "apt-setup/another" has no template field. Warning: question "apt-setup/cd/another" has no template field. Warning: question "apt-setup/cd/dev" has no template field. Warning: question "apt-setup/baddir" has no template field. Warning: question "adduser/homedir-permission" has no template field. Warning: question "apt-setup/contrib" has no template field. Warning: question "apt-setup/badsource" has no template field. This is a variety of corrupt config.dat that I have seen before where template data somehow leaks into config.dat. I don't know how this can happen, besides disk corruption. Anyway, if you remove the items in config.dat mentioned above, that might be enough to salvage it. -- see shy jo

