Vagrant e MariaDB (provisão)

1

Estou tentando criar um arquivo de provisão que instale o MariaDB, mas ele continua falhando.

A disposição é assim:

sudo apt-get install -y software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://ftp.cc.uoc.gr/mirrors/mariadb/repo/10.0/ubuntu trusty main'

apt-get update -y
apt-get install -y mariadb-server

E o erro que estou recebendo é:

==> default: Preparing to unpack .../mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb ...
==> default: (B)00
[BLANK SPACES HERE]
==> default: Package configuration??????????????????????????????????????????????????????????????? Configuring mariadb-server-10.0 ?????????????????????????????????????????????????????????????????? While not mandatory, it is highly recommended that you set a password   ?????? for the MariaDB administrative "root" user.???????????? If this field is left blank, the password will not be changed.???????????? New password for the MariaDB "root" user:???????????? _______________________________________________________________________ ????????????<Ok>???
==> default: Failed to open terminal.debconf: whiptail output the above errors, giving up!
==> default: dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb (--unpack):
==> default:  subprocess new pre-installation script returned error exit status 255
==> default: Selecting previously unselected package libhtml-template-perl.
==> default: Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
==> default: Unpacking libhtml-template-perl (2.95-1) ...
==> default: Selecting previously unselected package mariadb-server.
==> default: Preparing to unpack .../mariadb-server_10.0.17+maria-1~trusty_all.deb ...
==> default: Unpacking mariadb-server (10.0.17+maria-1~trusty) ...
==> default: Processing triggers for man-db (2.6.7.1-1) ...
==> default: Errors were encountered while processing:
==> default:  /var/cache/apt/archives/mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb
==> default: E
==> default: :
==> default: Sub-process /usr/bin/dpkg returned an error code (1)
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: You might want to run 'apt-get -f install' to correct these.
==> default: The following packages have unmet dependencies:
==> default:  mariadb-server : Depends: mariadb-server-10.0 (= 10.0.17+maria-1~trusty) but it is not installed
==> default: E
==> default: :
==> default: Unmet dependencies. Try using -f.

Parece que não consegue abrir o terminal que pede para você digitar uma senha e falhar. Eu sempre posso instalar manualmente o MariaDB, mas gostaria de fazê-lo através do arquivo de provisão. Alguma idéia / sugestão?

    
por user3465843 28.04.2015 / 00:37

1 resposta

6

Eu tive um problema semelhante. Definir a variável de ambiente DEBIAN_FRONTEND=noninteractive funcionou para mim.

Então, no seu caso, você precisa executar (como root)

DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server
    
por 11.08.2015 / 04:31