Rudy Jessop
Rudy Jessop

Reputation: 962

debconf: unable to initialize frontend: Dialog

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.

Upvotes: 21

Views: 23047

Answers (3)

Frederic Henri
Frederic Henri

Reputation: 53733

can you add

export DEBIAN_FRONTEND="noninteractive"

before you run your script

If you're running apt with sudo, then you need to set DEBIAN_FRONTEND after invoking sudo and before invoking apt.

Example:

sudo DEBIAN_FRONTEND="noninteractive" apt install -y tzdata

Upvotes: 22

Amin Ya
Amin Ya

Reputation: 1938

Running the following fixed the issue for me:

echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

Upvotes: 8

gsaslis
gsaslis

Reputation: 3166

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 ; )

Upvotes: 0

Related Questions