Cannot install mariadb-server on Debian 12 with KDE

Debian bookworm KDE (and maybe other distributions like Ubuntu KDE etc.) there is this executable called akonadi that runs as default with the package akonadi-backend-mysql that requires its own MariaDB that - in theory - is completely separated from mariadb-server but in practice it's not.

This bug is officially tracked by Debian but it's unclear if, at the time of writing (2023-12-18), it will receive a fix in bookworm.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032047

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050416

already once fixed in https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/38198d0b9e1c7821ddd074e308b25034bdcdce5b but then Debian release managers considered it too risky to include in Debian 13 "Bookworm" and thus it got reverted, and pending to be re-applied in https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/48

The package mariadb-server itself should not interrupt the installation if your system is just running the standard Akonadi with its dedicated MariaDB. But indeed you may have no time to troubleshoot or hot-patch such critical package on yourself.

Anyway,

A simple and clean solution is to:

  • Stop Akonadi
  • Migrate Akonadi from MariaDB to SQLite
  • Start Akonadi again
  • Retry

Interestingly, the migration of Akonadi from MariaDB to SQLite is well covered by the official documentation of KDE (section "How do I switch from MySQL/PostgreSQL to SQLite?"). Read this documentation if you want further information about Akonadi itself, what it does, what kind of data it stores and why, etc.

https://userbase.kde.org/Akonadi

In short, as solution, from your desktop user:

akonadictl stop
rm -Rf $XDG_CONFIG_HOME/akonadi
rm -Rf $XDG_DATA_HOME/akonadi
rm -Rf $XDG_CONFIG_HOME/akonadi*
rm -Rf $XDG_DATA_HOME/akonadi*

Then edit the file $HOME/.config/akonadi/akonadiserverrc. From:

[%General]
Driver=QMYSQL

To:

[%General]
Driver=QSQLITE

Then start Akonadi again with akonadictl start and try again your MariaDB installation.

It worked for me exactly in this way in a laptop with Debian GNU/Linux bookworm KDE.