W3cubDocs

/MariaDB

MariaDB Package Repository Setup and Usage

MariaDB Corporation provides a convenient shell script to configure access to their MariaDB Package Repositories. It is available at:

The script will will set up 3 different repositories in a single repository configuration file. The repositories are

  • MariaDB Repository
  • MariaDB MaxScale Repository
  • MariaDB Tools Repository

The script can be executed in the following way:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

Repositories

The script will will set up 3 different repositories in a single repository configuration file.

MariaDB Repository

The MariaDB Repository contains software packages related to MariaDB Server, including the server itself, clients and utilities, client libraries, plugins, and Mariabackup.

The binaries in MariaDB Corporation's MariaDB Repository are currently identical to the binaries in MariaDB Foundation's MariaDB Repository that is configured with the MariaDB Repository Configuration Tool.

By default, the script will configure your system to install from the repository of the latest GA version of MariaDB. That is currently MariaDB 10.3. If a new major GA release occurs and you would like to upgrade to it, then you will need to either manually edit the repository configuration file to point to the new version, or run the MariaDB Package Repository setup script again.

The script can also configure your system to install from the repository of a different version of MariaDB if you use the --mariadb-server-version option.

If you would not like to configure the MariaDB Repository on your system, then you can use the --skip-server option to prevent the MariaDB Package Repository setup script from configuring it.

MariaDB MaxScale Repository

The MariaDB MaxScale Repository contains software packages related to MariaDB MaxScale.

By default, the script will configure your system to install from the repository of the latest GA version of MariaDB MaxScale. That is currently MariaDB MaxScale 2.4. If a new major GA release occurs and you would like to upgrade to it, then you will need to either manually edit the repository configuration file to point to the new version, or run the MariaDB Package Repository setup script again.

The script can also configure your system to install from the repository of a different version of MariaDB MaxScale if you use the --mariadb-maxscale-version option.

If you would not like to configure the MariaDB MaxScale Repository on your system, then you can use the --skip-maxscale option to prevent the MariaDB Package Repository setup script from configuring it.

MariaDB MaxScale is licensed under the Business Source License 1.1, so it is not entirely free to use for organizations who do not have a subscription with MariaDB Corporation. If you would like more information, see the information at MariaDB Business Source License (BSL): Frequently Asked Questions. If you would like to know how much a subscription to use MariaDB MaxScale would cost, see MariaDB Corporation's subscription pricing.

MariaDB Tools Repository

The MariaDB Tools Repository contains externally developed tools that may be useful with MariaDB.

This repository currently only contains Percona XtraBackup and its dependencies. Percona XtraBackup can also be installed from Percona's repository:

If you would not like to configure the MariaDB Tools repository on your system, then you can use the --skip-tools option to prevent the MariaDB Package Repository setup script from configuring it.

The MariaDB Tools Repository only contains packages related to Percona XtraBackup. If you are using MariaDB 10.1 or later, then we would also recommend that you look into using Mariabackup instead of Percona XtraBackup, since it is more compatible with MariaDB's features. Mariabackup is in the MariaDB Repository. This means that if you are using MariaDB 10.1 or later, then you probably don't need the MariaDB Tools Repository.

Supported Distributions

The script supports Linux distributions that are officially supported by MariaDB Corporation's MariaDB TX subscription. However, a MariaDB TX subscription with MariaDB Corporation is not required to use the MariaDB Package Repository.

The distributions currently supported by the script include:

  • Red Hat Enterprise Linux (RHEL) 7
  • CentOS 7
  • Debian 8 (Jessie)
  • Debian 9 (Stretch)
  • Debian 10 (Buster)
  • Ubuntu 16.04 LTS (Xenial)
  • Ubuntu 18.04 LTS (Bionic)
  • SUSE Linux Enterprise Server (SLES) 12
  • SUSE Linux Enterprise Server (SLES) 15

To install MariaDB on distributions not supported by the MariaDB Package Repository setup script, please consider using MariaDB Foundation's MariaDB Repository Configuration Tool. Some Linux distributions also include MariaDB in their own repositories.

Using the MariaDB Package Repository Setup Script

The script can be executed in the following way:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

The script will have to set up package repository configuration files, so it will need to be executed as root.

The script will also install the GPG public keys used to verify the signature of MariaDB software packages. If you want to avoid that, then you can use the --skip-key-import option.

If the script tries to create the repository configuration file and one with that name already exists, then the script will rename the existing file with an extension in the format ".old_[0-9]+", which would make the OS's package manager ignore the file. You can safely remove those files after you have confirmed that the updated repository configuration file works..

If you want to see the repository configuration file that would be created without actually doing so, then you can use the --write-to-stdout option. This also prevents the need to run the script as root,

If you want to download the script, rather than executing it, then you can do so in the following way:

curl -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

Options

To provide options to the script, you must tell bash to expect them by executing bash with the options -s --, like this:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |
    sudo bash -s -- --help
Option Description
--help Display a usage message and exit.
--mariadb-server-version=<version> Override the default MariaDB Server version. By default, the script will use 'mariadb-10.4'.
--mariadb-maxscale-version=<version> Override the default MariaDB MaxScale version. By default, the script will use '2.4'.
--os-type=<type> Override detection of OS type. Acceptable values include debian, ubuntu, rhel, and sles.
--os-version=<version> Override detection of OS version. Acceptable values depend on the OS type you specify.
--skip-key-import Skip importing GPG signing keys.
--skip-server Skip the 'MariaDB Server' repository.
--skip-maxscale Skip the 'MaxScale' repository.
--skip-tools Skip the 'Tools' repository.
--write-to-stdout Write output to stdout instead of to the OS's repository configuration file. This will also skip importing GPG public keys and updating the package cache on platforms where that behavior exists.

--mariadb-server-version

By default, the script will configure your system to install from the repository of the latest GA version of MariaDB. That is currently MariaDB 10.4. If a new major GA release occurs and you would like to upgrade to it, then you will need to either manually edit the repository configuration file to point to the new version, or run the MariaDB Package Repository setup script again.

The script can also configure your system to install from the repository of a different version of MariaDB if you use the --mariadb-server-version option.

The string mariadb- has to be pre-pended to the version number. For example, to configure your system to install from the repository of MariaDB 10.3, that would be:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |
    sudo bash -s -- --mariadb-server-version="mariadb-10.3"

The following MariaDB versions are currently supported:

  • mariadb-5.5
  • mariadb-10.0
  • mariadb-10.1
  • mariadb-10.2
  • mariadb-10.3
  • mariadb-10.4

If you want to pin the repository of a specific minor release, such as MariaDB 10.3.9, then you can also specify the minor release. For example, mariadb-10.3.9. This may be helpful if you want to avoid upgrades. However, avoiding upgrades is not recommended, since minor releases can contain important bug fixes and fixes for security vulnerabilities.

--mariadb-maxscale-version

By default, the script will configure your system to install from the repository of the latest GA version of MariaDB MaxScale. That is currently MariaDB MaxScale 2.4. If a new major GA release occurs and you would like to upgrade to it, then you will need to either manually edit the repository configuration file to point to the new version, or run the MariaDB Package Repository setup script again.

The script can also configure your system to install from the repository of a different version of MariaDB MaxScale if you use the --mariadb-maxscale-version option.

For example, to configure your system to install from the repository of MariaDB MaxScale 2.3, that would be:

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |
    sudo bash -s -- --mariadb-maxscale-version="2.3"

The following MariaDB MaxScale versions are currently supported:

  • MaxScale 1.4
  • MaxScale 2.0
  • MaxScale 2.1
  • MaxScale 2.2
  • MaxScale 2.3
  • MaxScale 2.4

The special identifiers latest (for the latest GA release) and beta (for the latest beta release) are also supported.

--os-type and --os-version

If you want to run this script on an unsupported OS that you believe to be package-compatible with an OS that is supported, then you can use the --os-type and --os-version options to override the script's OS detection. If you use either option, then you must use both options.

The supported values for --os-type are:

  • rhel
  • debian
  • ubuntu
  • sles

If you use a non-supported value, then the script will fail, just as it would fail if you ran the script on an unsupported OS.

The supported values for --os-version are entirely dependent on the OS type.

For Red Hat Enterprise Linux (RHEL) and CentOS, 6 and 7 are valid options.

For Debian and Ubuntu, the version must be specified as the codename of the specific release. For example, Debian 9 must be specified as stretch, and Ubuntu 18.04 must be specified as bionic.

These options can be useful if your distribution is a fork of another distribution. As an example, Linux Mint 8.1 is based on and is fully compatible with Ubuntu 16.04 LTS (Xenial). Therefore, If you are using Linux Mint 8.1, then you can configure your system to install from the repository of Ubuntu 16.04 LTS (Xenial). If you would like to do that, then you can do so by specifying --os-type=ubuntu and --os-version=xenial to the MariaDB Package Repository setup script .

--write-to-stdout

The --write-to-stdout option will prevent the script from modifying anything on the system. The repository configuration will not be written to the repository configuration file. Instead, it will be printed to standard output. That allows the configuration to be reviewed, redirected elsewhere, consumed by another script, or used in some other way.

The --write-to-stdout option automatically enables --skip-key-import.

Platform-Specific Behavior

Platform-Specific Behavior on RHEL and CentOS

On Red Hat Enterprise Linux (RHEL) and CentOS, the MariaDB Package Repository setup script performs the following tasks:

  • Creates a repository configuration file at /etc/yum.repos.d/mariadb.repo.
  • Imports the GPG public key used to verify the signature of MariaDB software packages with rpm --import from downloads.mariadb.com.

Platform-Specific Behavior on Debian and Ubuntu

On Debian and Ubuntu, the MariaDB Package Repository setup script performs the following tasks:

  • Creates a repository configuration file at /etc/apt/sources.list.d/mariadb.list.
  • Creates a package preferences file at /etc/apt/preferences.d/mariadb-enterprise.pref, which gives packages from MariaDB repositories a higher priority than packages from OS and other repositories, which can help avoid conflicts. It looks like the following:
Package: *
Pin: origin downloads.mariadb.com
Pin-Priority: 1000
  • Imports the GPG public key used to verify the signature of MariaDB software package with apt-key from the keyserver.ubuntu.com key server.
  • Updates the package cache with package definitions from the MariaDB Package Repository with apt-get update.

Platform-Specific Behavior on SLES

On SUSE Linux Enterprise Server (SLES), the MariaDB Package Repository setup script performs the following tasks:

  • Creates a repository configuration file at /etc/zypp/repos.d/mariadb.repo.
  • Imports the GPG public key used to verify the signature of MariaDB software packages with rpm --import from downloads.mariadb.com.

Installing Packages with the MariaDB Package Repository

After setting up the MariaDB Package Repository, you can install the software packages in the supported repositories.

Installing Packages on RHEL and CentOS

To install MariaDB on Red Hat Enterprise Linux (RHEL) and CentOS, see the instructions at Installing MariaDB Packages with YUM. For example:

sudo yum install MariaDB-server MariaDB-client

To install MariaDB MaxScale on Red Hat Enterprise Linux (RHEL) and CentOS, see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo yum install maxscale

To install Percona XtraBackup on Red Hat Enterprise Linux (RHEL) and CentOS, you can do the following:

sudo yum install percona-xtrabackup

If you are using MariaDB 10.2, then you would need to install Percona XtraBackup 2.4:

sudo yum install percona-xtrabackup-24

Installing Packages on Debian and Ubuntu

To install MariaDB on Debian and Ubuntu, see the instructions at Installing MariaDB Packages with APT. For example:

sudo apt-get install mariadb-server mariadb-client

To install MariaDB MaxScale on Debian and Ubuntu, see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo apt-get install maxscale

To install Percona XtraBackup on Debian and Ubuntu, you can do the following:

sudo apt-get install percona-xtrabackup

If you are using MariaDB 10.2, then you would need to install Percona XtraBackup 2.4:

sudo apt-get install percona-xtrabackup-24

Installing Packages on SLES

To install MariaDB on SUSE Linux Enterprise Server (SLES), see the instructions at Installing MariaDB Packages with ZYpp. For example:

sudo zypper install MariaDB-server MariaDB-client

To install MariaDB MaxScale on SUSE Linux Enterprise Server (SLES), see the instructions at MariaDB MaxScale Installation Guide. For example:

sudo zypper install maxscale

To install Percona XtraBackup on SUSE Linux Enterprise Server (SLES), you can do the following:

sudo zypper install percona-xtrabackup

If you are using MariaDB 10.2, then you would need to install Percona XtraBackup 2.4:

sudo zypper install percona-xtrabackup-24
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/