Fail to start mariadb during installation on debian 12.4

Hi, I’m completely newbe so sorry. I’m tring to install nextcloud on Debian 12.4 (kernel 6.6.3) operation system on my NAS Zyxel 325v2 (Marvell ARMv5 processor) 1,Ghz, 512 MB RAM and I encountered problem
during strting MariaDB server (fresh installation). When installing mariadb and mariadb-client, I get the message as below.

root@debian:/etc/ssh# apt install mariadb-server
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following additional packages will be installed:
libmariadb3 mariadb-client mariadb-client-core mariadb-common
Suggested packages:
mailx mariadb-test netcat-openbsd
Recommended packages:
libdbd-mariadb-perl | libdbd-mysql-perl libterm-readkey-perl
libhtml-template-perl mariadb-plugin-provider-bzip2
mariadb-plugin-provider-lz4 mariadb-plugin-provider-lzma
mariadb-plugin-provider-lzo mariadb-plugin-provider-snappy pv
The following NEW packages will be installed:
libmariadb3 mariadb-client mariadb-client-core mariadb-common mariadb-server
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/12.8 MB of archives.
After this operation, 161 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages …
Selecting previously unselected package mariadb-common.
(Reading database … 36138 files and directories currently installed.)
Preparing to unpack …/mariadb-common_1%3a10.11.4-1~deb12u1_all.deb …
Unpacking mariadb-common (1:10.11.4-1~deb12u1) …
Selecting previously unselected package libmariadb3:armel.
Preparing to unpack …/libmariadb3_1%3a10.11.4-1~deb12u1_armel.deb …
Unpacking libmariadb3:armel (1:10.11.4-1~deb12u1) …
Selecting previously unselected package mariadb-client-core.
Preparing to unpack …/mariadb-client-core_1%3a10.11.4-1~deb12u1_armel.deb …
Unpacking mariadb-client-core (1:10.11.4-1~deb12u1) …
Selecting previously unselected package mariadb-client.
Preparing to unpack …/mariadb-client_1%3a10.11.4-1~deb12u1_armel.deb …
Unpacking mariadb-client (1:10.11.4-1~deb12u1) …
Selecting previously unselected package mariadb-server-core.
Preparing to unpack …/mariadb-server-core_1%3a10.11.4-1~deb12u1_armel.deb …
Unpacking mariadb-server-core (1:10.11.4-1~deb12u1) …
Setting up mariadb-common (1:10.11.4-1~deb12u1) …
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mariadb-server.
(Reading database … 36381 files and directories currently installed.)
Preparing to unpack …/mariadb-server_1%3a10.11.4-1~deb12u1_armel.deb …
Unpacking mariadb-server (1:10.11.4-1~deb12u1) …
Setting up libmariadb3:armel (1:10.11.4-1~deb12u1) …
Setting up mariadb-server-core (1:10.11.4-1~deb12u1) …
Setting up mariadb-client-core (1:10.11.4-1~deb12u1) …
Setting up mariadb-client (1:10.11.4-1~deb12u1) …
Setting up mariadb-server (1:10.11.4-1~deb12u1) …
Stopping MariaDB database server: mariadbd.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mariadb.service: No such file or directory
Starting MariaDB database server: mariadbd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mariadb, action “start” failed.
dpkg: error processing package mariadb-server (–configure):
installed mariadb-server package post-installation script subprocess returned error exit status 1
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 no error on /var/log/mysql because there is no such directory. It looks like installation was interrupted and log file was not created. But on /var/log/journal/mariadb.service.log I see something like this :

ERROR:systemctl:Unknown operation unset-enviroment.

When I type “apt upgrade” I see that 1 package was not fully installed or removed. Debian tries to install it but gets the error as above. I even try mysql_install_db, but with no success. I’m using an ARMv5 processor, so could this be a problem? How to fix it?

If you think your installed didn’t go through, you just might to try a reinstall:

sudo apt-get install --reinstall packagename


512 MB RAM is not much, just the minimum requirement. The performance will not be great, you probably need some tuning to reduce the RAM consumption and think about what services you really need.