Package 'mysql-server' has no installation candidate on Debian 13
We earn commissions when you shop through the links below.
We made apt’s “no installation candidate” for mysql-server on a fresh Debian 13, read what apt offers instead, installed it and logged in.
Short answer: run sudo apt install mariadb-server instead of
sudo apt install mysql-server. On 7 October 2026, on a fresh Debian 13,
sudo apt install mysql-server failed with
Error: Package 'mysql-server' has no installation candidate,
and in the lines above it apt named the package that replaces it. That package gave us
MariaDB 11.8.6, and sudo mariadb logged in.
What this was run on, and what it does not cover
We ran every command on this page on a fresh virtual machine at a cloud provider, started from a Debian 13 image, where a script ran the commands and kept everything the machine printed. A block marked Output shows what the command above it printed, or the lines of it that matter, and a line is always shown whole.
date -u +%Y-%m-%d
lsb_release -a
whoami
2026-10-07
Description: Debian GNU/Linux 13 (trixie)
admin
That is one release of Debian, one machine, one day and one architecture,
x86_64. The user admin was made for this run by the provider's
login and given sudo rights by a file of its own; it was taken out of the provider's sudo
group, and two groups that login had made for it were removed. Before the first command the
package source that the image's provider had added, and its key, were moved away. Nothing
else was changed.
The machine had no MySQL and no MariaDB client: the next look printed nothing. Then the package lists, as before any install; this is the last line that command printed.
command -v mysql mariadb
sudo apt update
11 packages can be upgraded. Run 'apt list --upgradable' to see them.
This page covers one cause of the error: Debian 13's own archive, and the package name
mysql-server. It doesn't cover installing MySQL itself from another source,
the differences between MariaDB and MySQL, securing the server, or a password for
root. Our page on
ERROR 1698 for root on Ubuntu 24.04
shows how a fresh MySQL server there checks that account.
Error: Package 'mysql-server' has no installation candidate
This is the command that fails, made on purpose. We show apt's lines from the first one about the package on; the status lines before them are left out.
sudo apt install mysql-server
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-server
Error: Package 'mysql-server' has no installation candidate
Why apt refuses
apt says it in those lines: the name mysql-server is known to the archive only
because another package refers to it, there is no package of that name to install, and
mariadb-server replaces it. Debian's archive has a package that stands for
a MySQL server, default-mysql-server, and this is what it depends on.
apt-cache depends default-mysql-server
default-mysql-server
Depends: mariadb-server-compat
Breaks: <mysql-server>
Debian's page for that package describes it as one that "depends on the default
implementation", and names mariadb-server-compat as "MySQL compatibility links
to mariadb-server binaries/scripts"
(default-mysql-server in Debian 13). So on this release the archive's
stand-in for a MySQL server leads to MariaDB.
The fix: install the package apt names
At a terminal apt asks whether to continue, and the script typed y.
sudo apt install mariadb-server
Continue? [Y/n] y
mariadb --version
mariadb from 11.8.6-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
The look from before the install now finds both names.
command -v mysql mariadb
/usr/bin/mysql
/usr/bin/mariadb
The client run through sudo logs in. At the prompt the script typed
SELECT CURRENT_USER();, which returns the account "that the server used to
authenticate the current client"
(MariaDB's documentation), and exit, which leaves.
sudo mariadb
MariaDB [(none)]> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| root@localhost |
MariaDB [(none)]> exit
Bye
After the install the first command is refused as before, with the same lines.
sudo apt install mysql-server
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-server
Error: Package 'mysql-server' has no installation candidate
The app is free to try in your browser, without an account. To hear when Pro is ready, join the waitlist.
Sources
- Our own run: a script on a fresh Debian 13 machine on 7 October 2026. Every command and every output on this page is from the script and its log.
- Debian's package pages, default-mysql-server in Debian 13: what the package is and what it depends on.
- MariaDB's documentation, CURRENT_USER: what the function returns.
- Unix & Linux question 270872 (2016): where the error is asked about. We took nothing else from it.