Setting up and using the MariaDB Package Repository

You are viewing an old version of this article. View the current version here.

Overview

A convenient shell script to set up MariaDB repositories is available at https://downloads.mariadb.com/MariaDB/mariadb_repo_setup. It can be executed like this:

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

The script supports GNU/Linux operating systems officially supported under MariaDB Enterprise subscriptions (though a MariaDB Enterprise subscription is not required to use the repository). As of May 2017, these include:

  • Red Hat Enterprise Linux (RHEL)/CentOS 6 and 7
  • Debian 7 (wheezy) and 8 (jessie)
  • Ubuntu 14.04 LTS (trusty) and 16.04 LTS (xenial)
  • SUSE Linux Enterprise Server (SLES) 12

The script will will set up 3 packages repositories in a single repository definition file:

  • MariaDB Server/Cluster
  • MariaDB MaxScale
  • A tools repository that includes Percona XtraBackup and its dependencies

The script will also install trusted keys used to sign MariaDB software packages (see --skip-key-import below if you want to avoid that behavior).

If you want to see the repository file that will be created without needing to run the script as root, use the --write-to-stdout option.

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
OptionDescription
--helpDisplay a usage message and exit.
--mariadb-server-version=<version>Override the default MariaDB Server version. By default, the script will use 'mariadb-10.1'.
--mariadb-maxscale-version=<version>Override the default MariaDB MaxScale version. By default, the script will use 'latest'.
--skip-key-importSkip importing GPG signing keys.
--skip-serverSkip the 'MariaDB Server' repository.
--skip-maxscaleSkip the 'MaxScale' repository.
--skip-toolsSkip the 'Tools' repository.
--write-to-stdoutWrite output to stdout instead of to the OS's repository configuration. This will also skip importing GPG keys and updating the package cache on platforms where that behavior exists.

--mariadb-server-version

By default, the repository will be set up to install the latest GA version of MariaDB Server/Cluster at the time you run the script, currently MariaDB Server/Cluster 10.1. If a new major GA release occurs, you will need to manually edit the repository definition, or fetch and run the mariadb_repo_setup script again.

The MariaDB Server/Cluster version used can be specified using the --mariadb-server-version option to the script. Prepend mariadb- to the version number you want, for example mariadb-10.2.

MariaDB Server/Cluster major versions mariadb-5.5, mariadb-galera-5.5, mariadb-10.0, mariadb-galera-10.0, mariadb-10.1, and mariadb-10.2 are supported. You can also specify a specific minor version, such as mariadb-5.5.55, if you don't want upgrades for automatic security fixes (this is not recommended).

MariaDB until 10.0

Galera Cluster is included in the standard MariaDB Server packages from 10.1, but for previous versions, you must explicitly specify that you want to use the "galera" repository. Do this by setting --mariadb-server-version to either mariadb-galera-5.5 or mariadb-galera-10.0.

--mariadb-maxscale-version

By default, the repository will be set up to install the latest GA version of MariaDB MaxScale. If a new version of MaxScale is released after you create the repository, your package manager will automatically upgrade you to that new GA version. In some cases, this can introduce incompatibilities; please consult the MaxScale release notes for more information.

The MaxScale version used can be specified using the --mariadb-maxscale option to the script.

MaxScale major versions 1.4, 2.0, and 2.1 are supported. Also, symlinks latest and beta are supported, if you want to be automatically upgraded to the latest GA or beta release, respectively.

--write-to-stdout

The --write-to-stdout option will prevent the script from modifying anything on the system. The repository file will not be written to disk; rather, it will be printed to stdout so it can be reviewed, redirected elsewhere, consumed by another script, or used in some other way.

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

Examples

To set up the MariaDB Repository to install MariaDB Server 10.0, execute mariadb_repo_setup like this:

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

To set up the MariaDB Repository to install MariaDB Galera Cluster 10.0, execute mariadb_repo_setup like this:

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

Comments

Comments loading...
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.