Роман Кистин, По ссылке ниже (в ответе ky0) для oldstable есть готовый пакет версии аж 10.5. Зачем надо собирать из исходников при наличии готового пакета?
добавление сторонних репозиториев и установка из исходников — это нормальная практика, но для этого нужны веские причины. если таких причин нет — ставим «родные» пакеты.
apt-get install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.5 (>= 1:10.5.4+maria~stretch) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
apt purge mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mariadb-server' is not installed, so not removed
The following packages were automatically installed and are no longer required:
galera-3 mariadb-server-core-10.1 socat
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.