Newsgroups: gmane.linux.debian.user Date: Sat, 07 Aug 2004 14:51:16 -0400
On Sat, 07 Aug 2004 15:15:17 -0400, Alec Berryman wrote:
> > I'm new to Debian. Seems that Debian keeps all configuration data in > > a DB. Is there a way to backup this configuration data, so that > > next time when I have to reinstall Debian, using apt-get install > > <all my package list>, I don't have to answer those hard and tedious > > questions again? > > Look at the man page for dpkg; particularly, '--get-selections' and > '--set-selections'.
Hi, Alec, thanks for the reply,
The '—get-selections' and '—set-selections' only give your the list of packages, they won't save configuration for you.
If you don't know what I'm talking about, try apt-get install xfree on a box that doesn't have xfree.
Alec Berryman writes:
> Pipe the output of `dpkg --get-selections` to a file, copy that over to > the new computer, and pipe it into `dpkg --set-selections`. Then run > apt-get -f install; it'll attempt to install all packages on the first > computer. You'll still have to answer configuration questions, but you > won't need to specify packages.
Setting the debconf priority to "critical" will eliminate most, if not all, questions. Answer the remaining ones with anything. Restore /etc after doing "dpkg —set-selections < package-list", overwriting the default configuration.
man 7 debconf
You shouldn't need to reinstall Debian, though. If you are duplicating installations, look at the automatic installers such as FAI.
John Hasler
> I don't have man for debconf in section 7. Which package contains it?
debconf-doc.
> > Thanks, John, that's something I am thinking of as the last resort. > > Why as a last resort?
Hard disk crash. I've gone through the same pain as the original poster.
It is not enough to simply backup /etc, as some packages automatically generate config files from the debconf info (xfree86 being one). In these cases you want the debconf info to be accurate.
Is anyone able to answer the original question? I'd like to know the answer too.
How can you backup your debconf answers and restore them in such a way that it replaces re-entering the answers? I'd like something similar to dpkg —get/set—selections, but for debconf answers.
> > Hard disk crash. I've gone through the same pain as the original poster. > > So you mean restore, not reinstall.
Well, both. I restored my system by reinstalling it.
> Any package that overwrites your changes to config files and/or uses > debconf as a registry is seriously buggy.
For some packages, I will maintain its configuration through debconf, since I have no desire to understand another config file syntax and debconf is used well by the package to generate a config file given some basic information.
If I am to change some of that basic information, it needs to be in debconf. Therefore I need to be able to reload the debconf database from a backup. That is, it is not enough just to restore /etc. That will get the system back up and running with the same configuration at that point in time, but future reconfiguration through debconf will not work.
> > How can you backup your debconf answers and restore them in such a way > > that it replaces re-entering the answers? > > Back up /var/cache/debconf
While I accept that this is the correct answer, surely this is the wrong place to put this sort of data?
According to the filesystem hierarchy standard (FHS) at http://www.debian.org/doc/packaging-manuals/fhs/fhs-5.2.html , it says:
/var/cache is intended for cached data from applications. Such data is locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss. The data should remain valid between invocations of the application and rebooting the system.
I dont see how the debconf application can regenerate or restore this data should it be deleted.
More distressing for me is that I dont include /var/cache in my backups. According to FHS, I should not have to.
Thanks for your answers, John.
CHeers
> > Back up /var/cache/debconf > > While I accept that this is the correct answer, surely this is the wrong > place to put this sort of data?
There is a file /etc/debconf.conf This file contains debconf configuration It appears that you can change where debconf keeps its data by editing this file. While the powers that be are considering the issue, you can put your debconf data where ever you want.
Paul E Condon
> If I am to change some of that basic information, it needs to be in > debconf. Therefore I need to be able to reload the debconf database from > a backup. That is, it is not enough just to restore /etc. That will get > the system back up and running with the same configuration at that point > in time, but future reconfiguration through debconf will not work.
They will, but you may have to feed in some answers again.
Well-written packages (like postfix) will gather answers from files in /etc, but these are rather rare.
> > > How can you backup your debconf answers and restore them in such a way > > > that it replaces re-entering the answers? > > > > Back up /var/cache/debconf > > While I accept that this is the correct answer, surely this is the wrong > place to put this sort of data? > > [...] > > I dont see how the debconf application can regenerate or restore this > data should it be deleted.
The debconf database is nothing more than a temporary cache of answers gotten from the user. Debconf will regenerate this data by asking any questions it needs to.
Brian Nelson
> The debconf database is nothing more than a temporary cache of answers > gotten from the user. Debconf will regenerate this data by asking any > questions it needs to.
If the Debian designers had this attitude, everything would go into /var/cache:
What, you want to run oowriter? Oops, just deleted that from my cache. Downloading openoffice.org-bin.deb from www.debian.org. Please wait.
Jason
> > It is not enough to simply backup /etc, as some packages automatically > > generate config files from the debconf info (xfree86 being one). > > Any package that overwrites your changes to config files and/or uses > debconf as a registry is seriously buggy.
Seems like there's still an important question left unanswered. We've discussed how to duplicate installed packages. We've discussed how to dupliate debconf configuration. But, as Cameron points out, some packages need configuration files that are to be generated from the debconf database. dexconf does this for XFree86. In general, how does one know what utility/utilities to run in order to generate all the configuration files? Is the configuration-file-generating-utility for each package specified in the debconf DB?
Jason