Ubuntu – Thesql-server-5.7 package post-installation script subprocess returned error exit status 127

MySQLserver

I have a website server on Ubuntu server 18.04 with apache and mysql. The database stopped for no apparent reason. I just did a restart of mysql server to solve the issue but after a simple update I got some errors on mysql-server package. The update was for other packages and not mysql-server package. Mysql still stops at least once a week and each time I have to restarts the mysql-server.

Can some one help me to understand the error please ?

Here the result of: dpkg --configure -a

Configure mysql-server-5.7 (5.7.23-0ubuntu0.18.04.1) …
/var/lib/dpkg/info/mysql-server-5.7.postinst: ligne 191: /usr/share/mysql-common/configure-symlinks: no file or folder

dpkg: erreur de traitement du paquet mysql-server-5.7 (–configure) :
installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127

Best Answer

Your system is broken because you installed third party packages which collide with the MySQL packages provided with Ubuntu. This is the danger of adding third party repositories: you rely on them to not break your system. It's also difficult to tell you reliably exactly how to fix your system because we don't know exactly what these third parties have done to your system.

Try purging all MySQL and MariaDB related packages, deleting /var/lib/mysql and /etc/mysql, removing all third party apt repositories from /etc/apt/sources.list and /etc/apt/sources.list.d and then reinstalling MySQL from the official Ubuntu repositories again. This will wipe any existing database data that you have.

To get a list of MySQL and MariaDB packages, try something like dpkg -l|egrep mysql\|mariadb. To purge pacakges, using dpkg -P package1 package2 etc. You will need to purge all the relevant packages together to avoid dependency issues.

Related Question