Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql-server-5.7 is not configured yet

Tags:

mysql

I installed Mysql5.7 long time ago, afterwards I uninstalled it and installed MariaDB disabling apparmor (mysql) profile.

Now I uninstalled MariaDB and I'm trying to install mysql5.7 and I got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version (5.7.28-0ubuntu0.18.04.4).
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.28-0ubuntu0.18.04.4) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127
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.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I get this error when I use sudo dpkg --configre -a too.

I install the package using sudo apt install mysql-server. I tried to follow some guide online, I removed /var/lib/dpkg/info/mysql-server-5.7.postinst purged mariadb, mysql and tried a lot of things.

like image 529
Stefano Borzì Avatar asked Nov 20 '19 18:11

Stefano Borzì


1 Answers

Ok, I solved in this way:

  • I used Software & Updates application to remove mariadb sources
  • executed the followings steps (ref https://askubuntu.com/a/934576):
  • sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server
  • sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install
  • sudo apt install mysql-server
like image 131
Stefano Borzì Avatar answered Oct 23 '22 19:10

Stefano Borzì