0

I was having issue in mysql after ubnutu upgrade so I just followed steps like purge first then install new one sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7

But I am getting these errors while performing installations.

update-alternatives: error: alternative link /etc/mysql/my.cnf is already managed by my.cnf.bak
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 2
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
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

1 Answers1

0

Try running this and see how it goes.

sudo service mysql stop
sudo apt remove mysql*
sudo apt purge mysql*
sudo apt autoremove
sudo apt install mysql-server

To run the included security script:

sudo mysql_secure_installation

Please update your question with the output from this if you recieve any errors.

  • 1
    It is same as mention above, the errors are happening while installation mysql-server. The main issue is update-alternatives: error: alternative link /etc/mysql/my.cnf is already managed by my.cnf.bak – Nikunj Kanetiya Sep 14 '17 at 04:17