1

I need to automatically answer all dialoge (blue screenish Text GUI) questions when running dpkg-reconfigure exim4 as I have a bash script which will run on many servers.

Is there some way to automatically input text, press enter and select yes/no?

2 Answers2

1

Don't use dialogs, if it's just for dpkg.

Have a look at:

  • debconf-set-selections
  • DEBIAN_FRONTEND

http://www.microhowto.info/howto/perform_an_unattended_installation_of_a_debian_package.html

allo
  • 1,524
  • 1
  • 19
  • 35
0

dpkg-reconfigure exim4 is just an interface to easily create the text configuration files for exim. There is no advantage to finding a way to answer the questions automatically (if you did have to do that, expect would be a valid choice).

If you have a lot of servers you should provide or generate the files in /etc/exim directly. You could, for example, do this on one server, and the copy /etc/exim to the other servers. You just need to make sure that the hostname is taken from the real hostname and not overridden in the files.

Law29
  • 3,507
  • 1
  • 15
  • 28
  • exim4 was just an example. But you helped me out a lot. I did not know that all this (exim4 configs) can be configured manually. Thanks. –  Feb 07 '16 at 20:40
  • In general, in Linux, *everything* can be configured manually :) If exim was just an example, and you want to do unattended / automatic installation of a lot of debian packages, then @allo has a useful point. – Law29 Feb 07 '16 at 22:34