Bug #98953 update-rc.d: error: insserv rejected the header
Submitted: 15 Mar 2020 9:11 Modified: 16 Mar 2020 8:24
Reporter: Helious wu Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.7.29 OS:Ubuntu (16.04)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: dpkg: error processing package mysql-server (--configure)

[15 Mar 2020 9:11] Helious wu
Description:
   I'm a newer to Linux.I'd like to install mysql-server with following commands 'sudo apt-get install mysql-server'on ubuntu16.04.I found following errors which i couldn't solve.
#############################################
'''Errors'''
root@Helious:/tmp# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version (5.7.29-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.29-0ubuntu0.16.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
insserv: script mysql: service mysql already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

#########################################

So,I tried to use command 'sudo apt-get install -f",which shows the same error.
I check error which says
##############################
 "insserv: script mysql: service mysql already provided!"
############################### 
I try the command of "ps -ef | grep "mysql",which says
"root     30540 11086  0 17:00 pts/0    00:00:00 grep --color=auto mysqld"
which means no process of mysql running at background.
########################
 dpkg -l |grep mysql
ii  mysql-client                          5.7.29-0ubuntu0.16.04.1                         all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.7                      5.7.29-0ubuntu0.16.04.1                         amd64        MySQL database client binaries
ii  mysql-client-core-5.7                 5.7.29-0ubuntu0.16.04.1                         amd64        MySQL database core client binaries
ii  mysql-common                          5.7.29-0ubuntu0.16.04.1                         all          MySQL database common files, e.g. /etc/mysql/my.cnf
iU  mysql-server                          5.7.29-0ubuntu0.16.04.1                         all          MySQL database server (metapackage depending on the latest version)
iF  mysql-server-5.7                      5.7.29-0ubuntu0.16.04.1                         amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.7                 5.7.29-0ubuntu0.16.04.1                       
################################

How to repeat:
Every time I tried to "apt-get install mysql-server".
Also, I tried to resintall the mysql-server,but the same problem break out again.

Suggested fix:
Sorry,I really don't know how to fix it.
And i googled for the question.None of them suits me.
Thank you for your help.
[15 Mar 2020 9:19] Helious wu
This is mysqld status
###################################
root@Helious:/tmp# service mysqld status
‚óŹ mysqld.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/init.d/mysqld; bad; vendor preset: enabled)
   Active: active (exited) since Sun 2020-03-15 16:04:48 CST; 1h 9min ago
     Docs: man:systemd-sysv-generator(8)

Mar 15 16:04:48 Helious systemd[1]: Stopped LSB: start and stop MySQL.
Mar 15 16:04:48 Helious systemd[1]: Starting LSB: start and stop MySQL...
Mar 15 16:04:48 Helious mysqld[17032]: Starting MySQL
Mar 15 16:04:48 Helious mysqld[17032]:  *
Mar 15 16:04:48 Helious systemd[1]: Started LSB: start and stop MySQL.
Mar 15 16:04:49 Helious mysqld_safe[18509]: Logging to '/var/log/mysql/error.log'.
Mar 15 16:04:49 Helious mysqld[17032]: 2020-03-15T08:04:49.603047Z mysqld_safe A mysqld process already exists
Mar 15 16:04:49 Helious mysqld_safe[18533]: A mysqld process already exists
##################################
[16 Mar 2020 8:24] MySQL Verification Team
Hi,

This is not a bug. MySQL Server is already installed, that's what your system is telling you.

kind regards
Bogdan