12

I am building my own ubuntu VM with packer to host on Atlas and I'm using the packer build template.json to test if it will be a success if I was to use packer push template.json I am getting this error when the I run the mysql.sh script.

virtualbox-iso: debconf: unable to initialize frontend: Dialog
    virtualbox-iso: debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
    virtualbox-iso: debconf: falling back to frontend: Readline
    virtualbox-iso: Configuring mysql-server-5.6
    virtualbox-iso: ----------------------------
    virtualbox-iso:
    virtualbox-iso: While not mandatory, it is highly recommended that you set a password for the
    virtualbox-iso: MySQL administrative "root" user.
    virtualbox-iso:
    virtualbox-iso: If this field is left blank, the password will not be changed.
    virtualbox-iso:

What is it that I'm missing with debconf:

Thanks.

Rudy Jessop
  • 872
  • 1
  • 11
  • 23
  • Possible duplicate of [Is it possible to answer dialog questions when installing under docker?](https://stackoverflow.com/questions/22466255/is-it-possible-to-answer-dialog-questions-when-installing-under-docker) – ishandutta2007 Aug 08 '18 at 21:01

3 Answers3

12

can you add

export DEBIAN_FRONTEND="noninteractive"

before you run your script

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
1

Running the following fixed the issue for me:

echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
Amin Ya
  • 1,515
  • 1
  • 19
  • 30
  • I'd recommend to run `debconf-show debconf` to see the default so that it helps to restore the default, if something happens while executing the above. – Pothi Kalimuthu Jan 26 '23 at 05:51
0

hmmm... just a wild guess, from looking at the mysql.sh script, but shouldn't lines 22 & 23 also take into account the above if statement?

The mysql_package has changed name, so the selections in your debconf should probably be mysql-server-5.6 instead of mysql-server if [ $2 == "5.6" ] (which I believe is true in your case, as can be seen from your log ; )

gsaslis
  • 3,066
  • 2
  • 26
  • 32