2

My OS was updated to 16.04

During the upgrade there was a problem with mysql. This is the error message:

Setting up mysql-common (5.7.19-0ubuntu0.16.04.1) ...
update-alternatives: error: alternative link /etc/mysql/my.cnf is already managed by my.cnf.bak
dpkg: error processing package mysql-common (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried the solutions that were proposed in the following questions and none of them worked for me. The solutions that were tried:

  1. Error Installing mySql on Ubuntu 16.04
  2. Having trouble installing and removing MySQL in Ubuntu
  3. 16.04 upgrade broke mysql-server
  4. Having trouble installing and removing MySQL in Ubuntu

Is there any suggestion for another solution? Thanks

The output of ls -l /etc/mysql is:

drwxr-xr-x 2 root root 4096 Sep 22 17:29 conf.d
-rw-r--r-- 1 root root  839 Sep 19 13:52 my.cnf.bak
-rw-r--r-- 1 root root  839 Jan 21  2017 my.cnf.fallback
-rw-r--r-- 1 root root  839 Sep 19 13:51 mysql.cnf
THelper
  • 355
  • 5
  • 14
Sharon H
  • 21
  • 2
  • Which "all solutions" were proposed that you tried? This information will help us avoid wasting time suggesting solutions you've already tried. Please review https://askubuntu.com/help/how-to-ask and then [edit] your post. Thank you for helping us help you! – Elder Geek Sep 20 '17 at 00:15
  • Thank you for the clarification. Please [edit] the output of ls -l /etc/mysql into this post as well. I've edited your post to avoid having it closed as too broad. Please ask a different question regarding your system settings issue and include the error message that popped up on that. Thank you for helping us help you! – Elder Geek Sep 21 '17 at 23:44
  • Are you certain that you followed all the answers to the questions you listed in there entirety? https://askubuntu.com/a/762432/225694 looks promising. Pay close attention to step 3 and read the comments as well. I would especially draw your attention to this one and that one – Elder Geek Sep 21 '17 at 23:55
  • I followed https://askubuntu.com/a/762432/225694 and after step 4 I got the following error message: update-alternatives: error: alternative link /etc/mysql/my.cnf is already managed by my.cnf.bak dpkg: error processing package mysql-common (--configure): subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: mysql-common E: Sub-process /usr/bin/dpkg returned an error code (1) Thanks. – Sharon H Sep 23 '17 at 11:09
  • Please review my previous comment entirely. your output indicate that you clearly have a my.cnf.bak file in /etc/mysql as well as a my.cnf.fallback file. and ignored this comment which I drew your attention to entirely. – Elder Geek Sep 23 '17 at 16:29
  • 1
    Thanks a lot. I removed the file /var/lib/dpkg/alternatives/my.cnf.bak and it works! – Sharon H Sep 25 '17 at 05:53
  • Thanks @SharonH I spent two hours around these posts installing and uninstalling mysql, till I saw your comment. – LowFieldTheory Jun 16 '18 at 09:35

0 Answers0