The answer from swill is not how it is done correctly. If you want to have a package configuration without using the / dpkg script, then you want to use the debconf wait mechanism.
In your case, this means that you must do the following:
set the following environment variables to avoid debconf trying to ask the user any questions:
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
then imagine debconf with the following preseed.txt file (or any other settings you want):
tzdata tzdata/Areas select Europe tzdata tzdata/Zones/Europe select Berlin
you installed the previous preseed file by doing:
debconf-set-selections /your/preseed.txt
Now you can either install tzdata (if it is not already installed) via apt , or run dpkg-reconfigure . In the end, tzdata will be configured according to what you specified in your debconf preseed file.
Remember that you can automate a lot more using debconf prefetching. For example, in my queries I always set:
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 locales locales/default_environment_locale select en_US.UTF-8
You can always check the debconf settings of your current system by running debconf-get-selections . The result should give you some idea of ββwhat part of the system configuration you can automate with debconf preseeding.
josch Dec 19 '13 at 23:24 2013-12-19 23:24
source share