Before starting an upgrade please confirm that you have the backup of MySQL databases and users. Default backup is in the folder /backup/mysql

Also, make sure all your scripts/sites are compatible with the new version as there is no return back to an old version.

Check which version of MariaDB is installed on your server

rpm -qa|grep -i maria

MariaDB Repository Changes
Modify repo file to the version you want to upgrade
Edit File: /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

* Modify 10.2 with the version you want to upgrade
Example for upgrade to MariaDB 10.5

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Stop and remove the old version of MariaDB (Databases will not be removed)

service mysql stop
service mariadb stop
systemctl disable mariadb
rpm --nodeps -ev MariaDB-server

Install the new version of MariaDB

yum clean all
yum -y update "MariaDB-*"
yum -y install MariaDB-server
systemctl enable mariadb
service mariadb start
mysql_upgrade

Check for the custom configuration

diff -Bw /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf

Verify upgraded packages

rpm -qa|grep -i maria

The output should look like this (10.5.15 should be replaced with your new version)

MariaDB-server-10.5.15-1.el7.centos.x86_64
MariaDB-devel-10.5.15-1.el7.centos.x86_64
MariaDB-common-10.5.15-1.el7.centos.x86_64
MariaDB-compat-10.5.15-1.el7.centos.x86_64
MariaDB-client-10.5.15-1.el7.centos.x86_64
MariaDB-shared-10.5.15-1.el7.centos.x86_64

Yum repository list of the available versions
http://yum.mariadb.org/