There are 2 ways of installing MariaDB on Ubuntu 22.04 - from the Universe repo, or from the MariaDB repo.
1. Via Universe repo
The Ubuntu Universe team has updated mariadb
to 10.6.11.
Make sure the following lines are uncommented in /etc/apt/sources.list
:
deb http://archive.ubuntu.com/ubuntu jammy universe
deb http://archive.ubuntu.com/ubuntu jammy-updates universe
deb http://archive.ubuntu.com/ubuntu jammy-security universe
Then run sudo apt install mariadb-server
. Note that the Universe repo might be slower to implement security patches than the MariaDB repo - so some months may pass before an update hits this repo.
2. Via MariaDB official repo
Customize your repo configuration this page.
With the following selected:
- Distribution: 22.04 (Jammy)
- MariaDB version: 10.6
- Mirror: LiquidTelecom (Nairobi)
Run the following to add the repo:
sudo apt-get install apt-transport-https curl
sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo sh -c "echo 'deb https://mariadb.mirror.liquidtelecom.com/repo/10.6/ubuntu jammy main' >>/etc/apt/sources.list"
Now you can run the following to install the latest version:
sudo apt update
sudo apt install mariadb-server
This version will likely be patched more often than the Universe provided version.
It should also be possible to add the MariaDB repo, and then run sudo apt upgrade
to switch over to any newer version in the MariaDB repos.