mysql 5.7 community server non-interactive apt install

The accepted answer works. I simply want to put this links which gives some explanation about how to use debconf-set-selections and how to find the list of parameters.


This works for me if running as root

export DEBIAN_FRONTEND=noninteractive

debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-codename select trusty'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-distro select ubuntu'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt/'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-preview select '
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-product select Ok'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-server select mysql-5.7'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-tools select '
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/unsupported-platform select abort'

wget http://dev.mysql.com/get/mysql-apt-config_0.7.2-1_all.deb
dpkg -i mysql-apt-config_0.7.2-1_all.deb
apt-get update
apt-get install -y mysql-server-5.7

When running as non root user, exported variable(DEBIAN_FRONTEND) is not available with sudo. Making the variable part of dpkg command worked for me.

sudo DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.7.2-1_all.deb

Tags:

Mysql

Dpkg

Apt