Bug #80036 APT repo postinst script fails in noninteractive
Submitted: 18 Jan 2016 18:00 Modified: 3 Dec 2016 11:09
Reporter: Aleksandr Kuzminsky Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Package Repos Severity:S3 (Non-critical)
Version:0.6.0-1_all OS:Any
Assigned to: Lars Tangvald CPU Architecture:Any
Tags: mysql-apt-config

[18 Jan 2016 18:00] Aleksandr Kuzminsky
Description:
When installing APT repo config in non-interactive mode the postinst script exits with an error.

export DEBIAN_FRONTEND=noninteractive
# dpkg -i mysql-apt-config_0.6.0-1_all.deb
(Reading database ... 60979 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.6.0-1_all.deb ...
Unpacking mysql-apt-config (0.6.0-1) over (0.6.0-1) ...
Setting up mysql-apt-config (0.6.0-1) ...
OK
/var/lib/dpkg/info/mysql-apt-config.postinst: line 138: [: too many arguments

The sources file is malformed after that:

# cat /etc/apt/sources.list.d/mysql.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt//  mysql-apt-config
# deb http://repo.mysql.com/apt//  mysql-5.7

# deb-src http://repo.mysql.com/apt//  mysql-5.7

How to repeat:
Define DEBIAN_FRONTEND and install the repo config package.

export DEBIAN_FRONTEND=noninteractive
# dpkg -i mysql-apt-config_0.6.0-1_all.deb
[19 Jan 2016 5:28] Lars Tangvald
Noninteractive mode does not work in the current version. The issue is fixed for the next release of the apt-config package.
[9 Mar 2016 10:24] Dario Sanna
About 2 month ago:

"Noninteractive mode does not work in the current version. The issue is fixed for the next release of the apt-config package."

Please, can you provide a release date?
With best Regards
[16 Mar 2016 8:11] Lars Tangvald
Hi,

Sorry for the delay. The update should be released shortly after Easter.
[13 Apr 2016 11:02] Lars Tangvald
The new release, 0.7.2, has support for noninteractive mode. It will add the same default server version as interactive mode (5.6 if you have 5.6 installed, otherwise 5.7), but this can be overridden by also specifying MYSQL_SERVER_VERSION=mysql-5.6 (or mysql-5.7).

Can you verify that this now works as expected?
[13 Apr 2016 16:29] Aleksandr Kuzminsky
Works like a charm.

root@db01:~# export DEBIAN_FRONTEND=noninteractive
root@db01:~# dpkg -i mysql-apt-config_0.7.2-1_all.deb
Selecting previously unselected package mysql-apt-config.
(Reading database ... 62975 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.7.2-1_all.deb ...
Unpacking mysql-apt-config (0.7.2-1) ...
Setting up mysql-apt-config (0.7.2-1) ...
OK
root@db01:~#

root@db01:~# cat /etc/apt/sources.list.d/mysql.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7

deb-src http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7
root@db01:~#
[3 Dec 2016 11:09] Terje Røsten
Thanks for feedback!