Closed Al2Klimov closed 5 years ago
This is a common problem, there is no hard relation between icinga2 and any database server.
Main reason is because we can't depend on anything.
You first need to install mariadb-server
, and then any package that uses dbconfig-common
or directly uses the database.
I have no better solution...
If dbconfig-mysql (or whatever the package name is) would suggest (not depend on) mariadb-server, would mariadb-server be configured before dbconfig-mysql?
No it won't help: https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends
A Depends field takes effect only when a package is to be configured. It does not prevent a package being on the system in an unconfigured state while its dependencies are unsatisfied, ...
(The other three dependency fields, Recommends, Suggests and Enhances, are only used by the various front-ends to dpkg such as apt-get, aptitude, and dselect.)
Steps to reproduce
# wget -O - https://packages.icinga.com/icinga.key | apt-key add -
# apt update
# apt install icinga2-{bin,ido-mysql} mariadb-server
Result
"An error occurred while installing the database: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") . (...)"