0

We currently try to reinstall MySQL 5.7 on a Ubuntu 16.04.6 LTS Box

But the installation fails with this error:

#sudo apt-get install mysql-server mysql-client --fix-broken --fix-missing

[...]
dpkg: error processing package mysql-server (--configure):
 dependency problems — leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.27) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

We have purged the previous installation. sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*

Seems to work just fine, no error Messages. Afterwards we check with:

#dpkg-query -l mysql-server
dpkg-query: no packages found matching mysql-server

In addition, we have manually removed remaining folders, to make sure there are no leftovers which could interfere with a new install.

rm -rf /etc/mysql /var/lib/mysql

But still, every new try of installing still fails with that error. Does someone know what we can do to fix this situation?

Steven
  • 1

1 Answers1

0

I would try first remove MySQL:

sudo apt purge mysql-server mysql-client mysql-common
sudo apt autoremove
sudo mv -iv /var/lib/mysql /var/tmp/mysql-backup
sudo rm -rf /var/lib/mysql*

After this, I would install MySQL again:

sudo apt update
sudo apt install mysql-server
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation

Try this, and let me know, if it worked or not

SwissCodeMen
  • 103
  • 4
  • Thank you, but that gt us an error also. After the `sudo apt install mysql-server` `Setting up mysql-server-5.7 (5.7.29-0ubuntu0.16.04.1) ... /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory 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. ` – Steven Apr 14 '20 at 11:38