MariaDB Package Repository setup and usage

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

Overview

A convenient shell script to set up the MariaDB Package Repository 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

You will need to execute the script as root, so that it can write repository definition files. If you want to see the repository definition file that will be created without needing to run the script as root, use the --write-to-stdout option.

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).

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

Platform support

The script supports GNU/Linux operating systems officially supported under MariaDB Enterprise subscriptions (though a MariaDB Enterprise subscription is not required to use the MariaDB Package 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

To install MariaDB Server/Cluster (but not MariaDB MaxScale or Percona XtraBackup) on other platforms, please consider using MariaDB Foundation's repository configuration tool or installing MariaDB from your OS distribution.

Platform-specific behavior

On Ubuntu and Debian,

  • a repository definition file will be created at /etc/apt/sources.list.d/mariadb.list
  • a file will be created at /etc/apt/preferences.d/mariadb-enterprise.pref to give packages from MariaDB repositories highest priority, in order to avoid conflicts with packages from OS and other repositories:
    Package: *
    Pin: origin downloads.mariadb.com
    Pin-Priority: 1000
    
  • apt-key will be used to import package signing keys from the keyserver.ubuntu.com key server
  • apt-get update will be executed to update the package cache with package definitions from the MariaDB Package Repository.

On Red Hat Enterprise Linux (RHEL) and CentOS,

  • a repository definition file will be created at /etc/yum.repos.d/mariadb.repo
  • rpm --import will be used to import package signing keys from https://downloads.mariadb.com.

On SUSE Linux Enterprise Server (SLES),

  • a repository definition file will be created at /etc/zypp/repos.d/mariadb.repo
  • rpm --import will be used to import package signing keys from https://downloads.mariadb.com.

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-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-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 Package 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

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.