I am trying to install mysql-server on ubuntu 22.04 LTS but I am getting the following dpkg error message. How can I fix this issue ?
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-ore-8.0
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0
0 upgraded, 6 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/21.1 MB of archives.
After this operation, 182 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 201995 files and directories currently installed.)
Preparing to unpack .../mysql-common_1%3a10.5.15+maria~focal_all.deb ...
Unpacking mysql-common (1:10.5.15+maria~focal) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../mysql-client-core-8.0_8.0.28-0ubuntu4_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.28-0ubuntu4) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.28-0ubuntu4_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.28-0ubuntu4) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../mysql-server-core-8.0_8.0.28-0ubuntu4_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.28-0ubuntu4) ...
Setting up mysql-common (1:10.5.15+maria~focal) ...
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 202191 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.28-0ubuntu4_amd64.deb ...
Unpacking mysql-server-8.0 (8.0.28-0ubuntu4) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.28-0ubuntu4_all.deb ...
Unpacking mysql-server (8.0.28-0ubuntu4) ...
Setting up mysql-client-core-8.0 (8.0.28-0ubuntu4) ...
Setting up mysql-server-core-8.0 (8.0.28-0ubuntu4) ...
Setting up mysql-client-8.0 (8.0.28-0ubuntu4) ...
Setting up mysql-server-8.0 (8.0.28-0ubuntu4) ...
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 194: /usr/share/mysql-
common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Although running the command mysqld -V
command produce the following output -
/usr/sbin/mysqld Ver 8.0.28-0ubuntu4 for Linux on x86_64 ((Ubuntu))
Executing the command sudo service mysql start
produces the following error code -
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
systemctl stop exim4
andsystemctl disable exim4
. It took me ages to get ride of a sick myql-server installation. – PouJa Feb 28 '24 at 00:16Also check for any broken service link (
/etc/systemd/system/mysql.service
)Remove any MariaDB stuff (
sudo dpkg --get-selections | grep maria
)My experience may help here