10

I want to install MySQL 5.7 on Travis CI, which runs Ubuntu 12 virtual machines.

I'm willing to use the official MySQL APT repo:

wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb

But the problem is, installing this package opens an interactive menu asking the following question:

Which Server version do you wish to receive?  
    - mysql-5.6  
    - mysql-5.7-dmr

As the installation is part of an automated script, I'm not behind the terminal to answer the question. The only thing I can find in the doc is:

Selecting a Major Release Version

By default, all installations and upgrades for your MySQL server and the other required components come from the release series of the major version you have selected during the installation of the configuration package (see Adding the MySQL APT Repository). However, you can switch to another supported major release series at any time by reconfiguring the configuration package you have installed. Use the following command:

shell> sudo dpkg-reconfigure mysql-apt-config

But again, this opens an interactive menu.

How to install this APT repository and configure it to use mysql-5.7-dmr, on a non-interactive shell?

2
  • 1
    You want to look in to debconf microhowto.info/howto/… Sep 28, 2014 at 17:15
  • 1
    @hbdgaf if you expand that a bit, it could be an answer. also, generally self-contained answers are best, because links can go away. Sep 28, 2014 at 17:52

1 Answer 1

12

Courtesy @hbdgaf, this how-to put me on the right track:

export DEBIAN_FRONTEND=noninteractive
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb

I put together this gist for the whole process.

1
  • 1
    These four lines just saved me, thanks a lot ! Mar 4, 2015 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .