When you're up with an actual Debian 9-system, you won't get the lastest builds of the MariaDB-branch. Debian always had the history to priorize stability over actual features and packages. I was always okay with this, but due to a specific deployment scenario I needed a MariaDB from version 10.2 up. Alas, Debian 9 comes with 10.1 instead. Over the time I found many hints how to accomplish this but after all, it was an official MariaDB-page that helped me reach my goal. In addition, it also takes care of getting the best server for the repository according to your geographic location!
All you need to do to get this running (not caring of the distribution you use) is to visit https://downloads.mariadb.org/mariadb/repositories/and choose your path. In my example, I am using Debian 9 "Stretch" and want to use the stable 10.3 branch of MariaDB from a local mirror:
After you have made your choice, the site will equip you with three lines which will add the chosen repository to your system - as for me, these lines below worked well. The only difference to your needs should be line three as my repository is located in Esslingen, Germany.
Adding the Repository
Yours may be elsewhere, depending on your geographical location and its nearest mirror.
sudo apt-get install software-properties-common dirmngr sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror2.hs-esslingen.de/mariadb/repo/10.3/debian stretch main'
Getting Stuff done
After this has happened, we can fetch the latest updates on all repositories and install MariaDB 10.3:
sudo apt-get update sudo apt-get install mariadb-server
That's it - we're on stable 10.3-branch of MariaDB now without any hassle while using official repositories minus any workaround. Although many of those may do their job, I never saw any sense in using a slower Hongkong-located repository instead of a local one. This way helped me in my specific case and I hope it will serve you well, too!