Comprehensive guide to installing MariaDB using `yum` or `dnf` on RHEL, CentOS, and Fedora, covering repository configuration, GPG key import, and package installation.
On RHEL, CentOS, Fedora, and other similar Linux RPM based distributions, these provide MariaDB packages. These are supported by those distributions. If you have a particular need for a later version than what is in the distribution, then MariaDB provides repositories for them.
Using repositories rather than installing RPM allows for an ease of update when a new release is made. It is highly recommended to install the relevant RPM packages from MariaDB's
repository using yum or dnf. Centos 7 still uses yum, most others use dnf, and SUSE/openSUSE use zypper.
This page walks you through the simple installation steps using dnf and yum.
We currently have YUM/DNF repositories for the following Linux distributions, and for the versions that are in standard (not extended) support:
Red Hat Enterprise Linux (RHEL)
CentOS
Fedora
openSUSE
If you want to install MariaDB with yum, then you can configure yum to install from MariaDB Corporation's MariaDB Package Repository by using the .
MariaDB Corporation provides a MariaDB Package Repository for several Linux distributions that use yum to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, , , , and . The MariaDB Package Repository setup script automatically configures your system to install packages from the MariaDB Package Repository.
To use the script, execute the following command:
If you want to install MariaDB with yum, then you can configure yum to install from MariaDB Foundation's MariaDB Repository by using the .
The MariaDB Foundation provides a MariaDB repository for several Linux distributions that use yum to manage packages. This repository contains software packages related to MariaDB Server, including the server itself, , , , and . The MariaDB Repository Configuration Tool can easily generate the appropriate configuration file to add the repository for your distribution.
Once you have the appropriate repository configuration section for your distribution, add it to a file named MariaDB.repo under /etc/yum.repos.d/.
For example, if you wanted to use the repository to install on RHEL (any version), then you could use the following yum repository configuration in /etc/yum.repos.d/MariaDB.repo:
The example file above includes a gpgkey line to automatically fetch the
GPG public key that is used to verify the digital signatures of the packages in our repositories. This allows the yum, dnf, and rpm utilities to verify the integrity of the packages that they install.
If you wish to pin the yum repository to a specific minor release, or if you would like to do a yum downgrade to a specific minor release, then you can create a yum repository configuration with a baseurl option set to that specific minor release.
For example, if you wanted to pin your repository to on CentOS 7, then you could use the following yum repository configuration in /etc/yum.repos.d/MariaDB.repo:
To change an existing repository configuration, you may execute the following command:
MariaDB's yum repository can be updated to a new major release. How this is done depends on how you originally configured the repository.
If you configured yum to install from MariaDB Corporation's MariaDB Package Repository by using the , then you can update the major release that the repository uses by running the script again.
If you configured yum to install from MariaDB Foundation's MariaDB Repository by using the , then you can update the major release that the repository uses by updating the yum repository configuration file in-place. For example, if you wanted to change the repository from to , and if the repository configuration file was at /etc/yum.repos.d/MariaDB.repo, then you could execute the following:
After that, the repository should refer to .
If the yum repository is pinned to a specific minor release, then the above sed command can result in an invalid repository configuration. In that case, the recommended options are:
Edit the MariaDB.repo repository file manually.
Or delete the MariaDB.repo repository file, and then install the repository of the new version with the more robust .
See the page for information on the various keys used by MariaDB.
After the dnf/yum repository is configured, you can install MariaDB by executing the or command. The specific command that you would use would depend on which specific packages that you want to install.
To Install the most common packages, execute the following command:
To Install MariaDB Server, execute the following command:
The process to install MariaDB Galera Cluster with the MariaDB yum repository is practically the same as installing standard MariaDB Server.
You need to install the galera-4 package to obtain the 4 wsrep provider library.
To install MariaDB Galera Cluster, you could execute the following command:
If you haven't yet imported the MariaDB GPG public key, then yum will prompt you to
import it after it downloads the packages, but before it prompts you to install them.
See for more information on MariaDB Galera Cluster.
has been included as the client library (staticly linked). However, the package name for the client library has not been changed.
To Install the clients and client libraries, execute the following command:
If you want compile your own programs against MariaDB Connector/C, execute the following command:
To install , execute the following command:
Some may also need to be installed.
For example, to install the password validation plugin, execute the following command:
The MariaDB yum repository also contains packages. These package may be needed when .
To install for the most common packages, execute the following command:
All packages have their debuginfo by appending -debuginfo to the package name.
To install for MariaDB Server, execute the following command:
The MariaDB yum repository contains the last few versions of MariaDB. To show what versions are available, use the following command:
The output shows the available versions. For example:
The MariaDB repository in this example contains MariaDB 12.1.2, 12.0.2, and 11.8.2; and the appstream repository contains MariaDB 10.3.39.
To install an older version of a package instead of the latest version we just need to specify the package name, a dash, and then the version number. And we only need to specify enough of the version number for it to be unique from the other available versions.
However, when installing an older version of a package, if dependencies need to be installed, then it will automatically choose to install the latest versions of those packages, which can sometimes break those dependencies. To ensure that all MariaDB packages are on the same version in this scenario, it is necessary to specify them all.
The MariaDB packages that the MariaDB-server package depend on are: MariaDB-client, MariaDB-shared, and MariaDB-common. Therefore, to install MariaDB 12.0.2 from this yum
repository, we could do the following (putting the version in a variable and each package on its own line so things are cleaner):
For MariaDB Enterprise it is necessary to specify the release part of the version number as well, but with an underscore (_) instead of a dash (-), as that is how dnf/yum see the version number. For example, for MariaDB Enterprise Server 11.8.5-2 you would specify the version as 11.8.5_2. For example:
The rest of the install and setup process is as normal.
After the installation is complete, you can with:
If you are using , then keep in mind that the first node will have to be .
This page is licensed: CC BY-SA / Gnu FDL
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.6/rhel/$releasever/$basearch
gpgkey= https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1[mariadb]
name = MariaDB-10.8.8
baseurl= http://archive.mariadb.org/mariadb-10.8.8/yum/centos/$releasever/$basearch
gpgkey= https://archive.mariadb.org/PublicKey
gpgcheck=1sudo yum clean allsudo sed -i 's/10.6/10.11/' /etc/yum.repos.d/MariaDB.reposudo dnf install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-commonsudo dnf install MariaDB-serversudo dnf install MariaDB-server MariaDB-client galera-4sudo dnf install MariaDB-client MariaDB-sharedsudo dnf install MariaDB-develsudo yum install MariaDB-backupsudo dnf install MariaDB-cracklib-password-checksudo dnf install MariaDB-server-debuginfo MariaDB-client-debuginfo MariaDB-shared-debuginfo MariaDB-backup-debuginfo MariaDB-common-debuginfosudo dnf install MariaDB-server-debuginfosudo dnf list --showduplicates MariaDB-serversudo dnf list --showduplicates MariaDB-server
Last metadata expiration check: 0:01:42 ago on Fri 12 Dec 2025 03:47:20 PM UTC.
Available Packages
MariaDB-server.x86_64 11.8.2-1.el8 mariadb-main
MariaDB-server.x86_64 12.0.2-1.el8 mariadb-main
MariaDB-server.x86_64 12.1.2-1.el8 mariadb-main
mariadb-server.x86_64 3:10.3.39-1.module+el8.8.0+1452+2a7eab68 appstreamver=12.0.2
sudo dnf install \
MariaDB-server-${ver} \
MariaDB-client-${ver} \
MariaDB-shared-${ver} \
MariaDB-common-${ver}ver=11.8.5_2
sudo dnf install \
MariaDB-server-${ver} \
MariaDB-client-${ver} \
MariaDB-shared-${ver} \
MariaDB-common-${ver}sudo systemctl start mariadb