Linux Bugs

How to install MariaDB 10 on Debian 11 Bullseye Linux

Guide to learn how to install MariaDB 10 on Debian 11 Bullseye. Currently, at the time of writing this tutorial, the latest version was MariaDB Server 10.6.

The default version available for installation on Debian 11 Linux when running this guide was MariaDB 10.5, but the latest version available is 10.6. The new version comes with some updates and new features in the following areas:

  • Atomic DDL
  • SQL syntax
  • Oracle compatibility
  • InnoDB
  • Replication, Galera and Binlog
  • Performance diagram
  • Storage motors
  • Correction of security vulnerabilities

For full details of bugs fixed and new features added, see the official page which listed improvements in 10.06.

Install MariaDB Server 10.6 on Debian 11 Bullseye Linux

1. Refresh the repository cache

Run the system update command which will install all available updates as well as the system repository cache refresh.

sudo apt update


To note: If you want the version available by default in the Debian 11 base repository, you can check it with a command:

apt show mariadb-server

While to install it the command will be:

sudo apt install mariadb-server


Those who want version 10.6 can go further …

2. Install common packages

There are few packages that we need to easily manage our distribution and independent software vendor sources.

sudo apt-get install software-properties-common dirmngr

2. Importing the MariaDB GPG public key on Debian 11

Let’s download and add a GPG key, signed by the MariaDB developers to verify the packages we get to install this database. This will help the system to confirm if the packages are from the genuine source and have not been modified.

sudo chmod -c 644 mariadb_release_signing_key.asc
sudo mv -vi mariadb_release_signing_key.asc /etc/apt/trusted.gpg.d/

3. Add a repository

Then add the MariaDB repository intended to obtain version 10.06 manually on your Linux Debian 11; using the command below:

Paste the whole block command and press the Enter key.

echo "deb [arch=amd64,arm64,ppc64el] 
bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list
sudo apt update

4. Install MariaDB 10.6 on Debian 11 Bullseye

After performing all of the above commands, we can easily install MariaDB 10.6. To check and confirm, we can use the APT display the command:

apt show mariadb-server

To install it:

sudo apt install mariadb-server

5. Check the status of the database server

After the installation is complete, we can check the version and status of the database server, whether it is running in the background or not.

mariadb --version
systemctl status mariadb

Whereas, to stop, restart and deactivate the service:

sudo systemctl stop mariadb

To activate and deactivate, so that it does not start automatically:

sudo systemctl enable mariadb
sudo systemctl disable mariadb

To restart:

sudo systemctl restart mariadb

6. Secure installation of MariaDB

If you are about to use a database in an application over a public network, it is recommended to run a command to secure the MariaDB.


When you run the command, a text wizard opens, follow it. Set the root password for MariaDB, delete the demo database, disable remote login, and delete anonymous user accounts.

secure installation of MariaDB

Uninstallation – MariaDB 10

If you don’t need the database on your Debian server or desktop, use the commands below:

sudo apt remove maridb-server

Delete the GPG key

sudo rm /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc

Delete the repository

sudo rm /etc/apt/sources.list.d/mariadb.list

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *