From 89386032ae0836c8fe5b64831c9342ac8c074c5b Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Sat, 20 Apr 2019 00:10:44 +1200 Subject: Fix MariaDB image build The error in MariaDB installation during the guest image building: ``` apt-get -y install socat percona-xtrabackup percona-xtrabackup : Depends: libcurl4 (>= 7.16.3) but it is not installable Depends: libgcrypt20 (>= 1.8.0) but 1.6.5-2ubuntu0.5 is to be installed Depends: libssl1.1 (>= 1.1.0) but it is not installable E: Unable to correct problems, you have held broken packages. ``` This patch fixes the issue based on the process described in https://mariadb.com/kb/en/library/installing-mariadb-deb-files Change-Id: I368bddabffcc0f11f7181b3a33be1f213f0bdaba --- .../pre-install.d/10-percona-apt-key | 26 --------------- .../ubuntu-xenial-mariadb/install.d/30-mariadb | 38 ++++++++++------------ 2 files changed, 17 insertions(+), 47 deletions(-) delete mode 100755 integration/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key diff --git a/integration/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key b/integration/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key deleted file mode 100755 index 83bf9435..00000000 --- a/integration/scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# CONTEXT: GUEST during PRE-CONSTRUCTION as ROOT -# PURPOSE: Setup apt-repo list so that we can connect to Percona's repo - -set -e -set -o xtrace - -[ -n "${GUEST_USERNAME}" ] || die "GUEST_USERNAME needs to be set to the user for the guest image" -[ -n "${RELEASE}" ] || die "RELEASE must be set to either Trusty or Precise" - -# Add Percona GPG key -mkdir -p /home/${GUEST_USERNAME}/.gnupg - -get_key_robust 1C4CBDCDCD2EFD2A -get_key_robust 9334A25F8507EFA5 - -# Add Percona repo -# Creates the Percona sources list -cat < /etc/apt/sources.list.d/percona.list -deb http://repo.percona.com/apt $RELEASE main -deb-src http://repo.percona.com/apt $RELEASE main -EOL - -# Force an update -apt-get -y update diff --git a/integration/scripts/files/elements/ubuntu-xenial-mariadb/install.d/30-mariadb b/integration/scripts/files/elements/ubuntu-xenial-mariadb/install.d/30-mariadb index 85b86d5d..42799364 100755 --- a/integration/scripts/files/elements/ubuntu-xenial-mariadb/install.d/30-mariadb +++ b/integration/scripts/files/elements/ubuntu-xenial-mariadb/install.d/30-mariadb @@ -2,40 +2,36 @@ # CONTEXT: GUEST during CONSTRUCTION as ROOT # PURPOSE: Install controller base required packages +# Refer to https://mariadb.com/kb/en/library/installing-mariadb-deb-files set -e set -o xtrace export DEBIAN_FRONTEND=noninteractive -# NOTE(vkmc): Using MariaDB repositories is required -# https://mariadb.com/kb/en/mariadb/installing-mariadb-deb-files/ -apt-get -y install software-properties-common +# These GPG key IDs are used to fetch keys from a keyserver on Ubuntu & Debian +apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 +curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | + bash -s -- --mariadb-server-version="mariadb-10.4" --skip-key-import --skip-maxscale -get_key_robust 0xF1656F24C74CD1D8 +# NOTE(lxkong): Refer to https://www.percona.com/doc/percona-xtrabackup/2.4/installation/apt_repo.html +wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb +dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb -add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu xenial main' +apt-get update -# Pin MariaDB repository -sudo echo -e "Package: *\nPin: origin ftp.osuosl.org\nPin-Priority: 1000" > /etc/apt/preferences.d/mariadb.pref +# Disable password prompt +debconf-set-selections <<< "mariadb-server mysql-server/root_password password ''" +debconf-set-selections <<< "mariadb-server mysql-server/root_password_again password ''" -apt-get -y update -apt-get -y install socat percona-xtrabackup -apt-get -y install libmariadbclient18 mariadb-server +apt-get install -y --allow-unauthenticated mariadb-server mariadb-client galera-4 libmariadb3 mariadb-backup mariadb-common percona-xtrabackup-24 -cat >/etc/mysql/conf.d/no_perf_schema.cnf <<_EOF_ +cat </etc/mysql/conf.d/no_perf_schema.cnf [mysqld] performance_schema = off -_EOF_ +EOF -mv /etc/mysql/my.cnf.fallback /etc/mysql/my.cnf chown mysql:mysql /etc/mysql/my.cnf -cat >/etc/mysql/my.cnf <<_EOF_ -[mysql] - -!includedir /etc/mysql/conf.d/ -_EOF_ - -rm /etc/init.d/mysql +rm -f /etc/init.d/mysql systemctl daemon-reload -systemctl enable mariadb +systemctl enable mariadb \ No newline at end of file -- cgit v1.2.1