First, update the repository index.
sudo apt update
Install MariaDB Database
Install MariaDB from Official MariaDB Mirror
Update the repository index and install the required packages.
sudo apt update
sudo apt install -y software-properties-common dirmngr apt-transport-https wget curl
Add signing key to your system.
curl -fsSL https://mariadb.org/mariadb_release_signing_key.asc | sudo gpg --dearmor -o /usr/share/keyrings/mariadb-keyring.gpg
MariaDB foundation offers a repository for Debian to install MariaDB easily. You can choose any one of the download mirrors from the MariaDB download page to set up the repository on your system.
Add MariaDB repository using the below command.
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mariadb-keyring.gpg] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.6/debian bullseye main' | sudo tee /etc/apt/sources.list.d/mariadb.list
Install MariaDB server and client using the following command.
sudo apt update
sudo apt install -y mariadb-server mariadb-client
Read more