I'm starting with a new installation.

  1. sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
  2. sudo apt install ./mysql-apt-config_*_all.deb
  3. sudo apt update
  4. sudo apt install mysql-server

And at the end of install, i have this error :

Setting up mysql-community-client (8.0.36-1debian12) ...
Setting up mysql-client (8.0.36-1debian12) ...
Setting up mysql-community-server (8.0.36-1debian12) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 8.0.36-1debian12); however:
Package mysql-community-server is not configured yet.

dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u4) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried that on 2 different servers and i have the same error.

I didn't have this error a few months ago with the same steps.

  • try out: apt --force-yes install mysql-community-server then dpkg --configure -a Commented Feb 26 at 11:50
  • Thank you :) i have this message dpkg --configure -a : Setting up mysql-community-server (8.0.36-1debian12) ... Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service. Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145. Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145. And it doesn't works.
    – gaetan
    Commented Feb 26 at 15:52
  • @gaetan did you forget to issue the systemctl command with sudo?
    – eyoung100
    Commented Feb 29 at 20:56
  • I'm in root :). and it worked before.
    – gaetan
    Commented Mar 1 at 9:46

1 Answer 1


You never want to --force a package install of any package in any Package Manager as this usually just leads to more breakages/issues later.

Properly Install MySQL

  1. sudo apt remove mysql-server - Uninstall what's been forced
  2. sudo apt update - Make sure we're starting wit the most up-to-date repository changes
  3. Already done:
    • sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.26-1_all.deb
  4. sudo apt install ./mysql-apt-config_*_all.deb - Start the installer you just downloaded(which you have done):
    • Choose: MySQL Server and Cluster
    • Version 8.0
    • Highlight OK, Press Tab, press Enter.
  5. sudo apt install mysql-server <-- Did you alter this command with the -y option?

Stopping here for a moment: The package mysql-server is an alias to the Community Edition as seen in: MySQL Apt Install.

Note that you must use the alias mysql-server to pull in all the dependencies, one of which is the Community Server. I can't tell if a dependency is missing from the OP's partially posted apt run, or if he added the -y option.

To the OP: Did you see the my.cnf configuration screens during the attempt you posted? See Terminal photos in Step 3. The root database password, and the encryption method must be set before the --configure step can complete. If you added the -y option, this would write my.cnf with no root password/no encryption, which would cause the configure phase to fail.

  • Yes i saw the my.cnf and I fill in the password and other settings and i have to put yes otherwise the installer will abort. I have the same error, and i can't use version 8.0.26 with debian 12 the minimum viable version is 8.0.29. Every time i have the same error...
    – gaetan
    Commented Mar 1 at 9:39
  • I make the procedure work manually before automating it.
    – gaetan
    Commented Mar 1 at 9:53
  • Look here. Try gracious's answer and Deathgrips answer
    – eyoung100
    Commented Mar 1 at 16:14
  • I have tried many solutions but it doesn't works too :/ i have tried the installation of mariadb it works fine....
    – gaetan
    Commented Mar 1 at 16:43
  • Is systemd installed properly?
    – eyoung100
    Commented Mar 1 at 16:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .