When installing PS on Ubuntu, it prompts for password even when skipping it

Description

Installing PS on Ubuntu 16.04 asks for password, even when disabling asking for password as shown on https://serversforhackers.com/c/installing-mysql-with-debconf using  'export DEBIAN_FRONTEND="noninteractive"'.

 

Password prompts break script installation.

 

How to test on Ubuntu 16.04:

sudo su
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get install -y percona-server-server-5.7

 

If installing PXC or upstream MySQL it does not prompts for password when using 'export DEBIAN_FRONTEND="noninteractive"' which is expected behavior:

 

On PXC 5.7:

sudo su
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
apt-get update
export DEBIAN_FRONTEND="noninteractive"
apt-get install -y percona-xtradb-cluster-57

 

On upstream (before installing Percona packages):

apt update
export DEBIAN_FRONTEND="noninteractive"
apt install -y mysql-server mysql-client

 

You can remove "export" line and check that it prompts for password.

 

Expected behavior: when installing PS 5.7, if setting 'export DEBIAN_FRONTEND="noninteractive"' ,  password prompt should not trigger. 

Environment

OS: Ubuntu 16.04

Smart Checklist

Activity

Show:

Evgeniy Patlan May 5, 2019 at 8:17 PM

Hi .

I have investigated this issue and found the root of the issue.
Once you are executing commands you export nooninteractive param and after that execute apt command with sudo - so you are changes user space.
if you would remove sudo from apt command everything would work well; 

Cannot Reproduce

Details

Assignee

Reporter

Time tracking

1h logged

Components

Affects versions

Priority

Smart Checklist

Created May 2, 2019 at 9:27 PM
Updated March 6, 2024 at 12:11 PM
Resolved May 5, 2019 at 8:17 PM