さくらVPSのCentOS8にMariaDB10.5.5をインストールするのに苦戦した


概要

さくらVPSにCentOS8を用意して、そこにMariaDB 10.5.5(2020/10/4時点最新)をインストールしようとしたところ、ちょっと苦戦したので記録を残します。

苦戦した内容

ネット記事を参考に、yumのリポジトリを用意してインストールしようとしたところnothing provides rsync needed by MariaDB-server-10.5.5-1.el8.x86_64というのが出てしまい、MariaDB-serverのインストールができないという事象に出会いました。

リポジトリの設定は、自作のリポジトリと、https://downloads.mariadb.com/MariaDB/mariadb_repo_setup からリポジトリを用意する2パターンで試し、どちらの場合もこの現象は解消できませんでした。

リポジトリの設定パターン①

/etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

リポジトリの設定パターン②

/etc/yum.repos.d/mariadb.repo
[mariadb-main]
name = MariaDB Server
baseurl = https://downloads.mariadb.com/MariaDB/mariadb-10.5/yum/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY
gpgcheck = 1
enabled = 1
module_hotfixes = 1

[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://downloads.mariadb.com/MaxScale/2.4/centos/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 1

[mariadb-tools]
name = MariaDB Tools
baseurl = https://downloads.mariadb.com/Tools/rhel/$releasever/$basearch
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Enterprise-GPG-KEY
gpgcheck = 1
enabled = 1

このリポジトリの内容でdnf installしようとすると以下のような感じになります。

# dnf info MariaDB-server MariaDB-devel --disablerepo=* --enablerepo=mariadb
メタデータの期限切れの最終確認: 5:58:32 時間前の 2020年10月04日 13時12分16秒 に実施しました。
利用可能なパッケージ
名前         : MariaDB-devel
バージョン   : 10.5.5
リリース     : 1.el8
Arch         : x86_64
サイズ       : 7.9 M
ソース       : MariaDB-devel-10.5.5-1.el8.src.rpm
リポジトリー : mariadb
概要         : MariaDB: a very fast and robust SQL database server
URL          : http://mariadb.org
ライセンス   : GPLv2
説明         : MariaDB: a very fast and robust SQL database server
             : 
             : It is GPL v2 licensed, which means you can use the it free of charge under the
             : conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
             : 
             : MariaDB documentation can be found at https://mariadb.com/kb
             : MariaDB bug reports should be submitted through https://jira.mariadb.org

名前         : MariaDB-server
バージョン   : 10.5.5
リリース     : 1.el8
Arch         : x86_64
サイズ       : 27 M
ソース       : MariaDB-server-10.5.5-1.el8.src.rpm
リポジトリー : mariadb
概要         : MariaDB: a very fast and robust SQL database server
URL          : http://mariadb.org
ライセンス   : GPLv2
説明         : MariaDB: a very fast and robust SQL database server
             : 
             : It is GPL v2 licensed, which means you can use the it free of charge under the
             : conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
             : 
             : MariaDB documentation can be found at https://mariadb.com/kb
             : MariaDB bug reports should be submitted through https://jira.mariadb.org

# dnf install MariaDB-server MariaDB-devel --disablerepo=* --enablerepo=mariadb
メタデータの期限切れの最終確認: 5:59:11 時間前の 2020年10月04日 13時12分16秒 に実施しました。
エラー: 
 問題: cannot install the best candidate for the job
  - nothing provides rsync needed by MariaDB-server-10.5.5-1.el8.x86_64
(インストール不可のパッケージをスキップするには、'--skip-broken' を追加してみてください または、'--nobest' を追加して、最適候補のパッケージのみを使用しないでください)

回避策

結局どうやっても解消できなかったので、単純にrpmを落としてきてインストールするという手順に切り替えました。

# cd /usr/local/src/
# curl -O https://downloads.mariadb.com/MariaDB/mariadb-10.5.5/yum/centos/mariadb-10.5.5-rhel-8-x86_64-rpms.tar
# tar xvf mariadb-10.5.5-rhel-8-x86_64-rpms.tar
# cd mariadb-10.5.5-rhel-8-x86_64-rpms
# dnf localinstall MariaDB-common-10.5.5-1.el8.x86_64.rpm
# dnf localinstall MariaDB-server-10.5.5-1.el8.x86_64.rpm
# dnf localinstall MariaDB-devel-10.5.5-1.el8.x86_64.rpm

とりあえず上記を実行したことで、MariaDBのインストールを進めることができました。

# mysql -V
mysql  Ver 15.1 Distrib 10.5.5-MariaDB, for Linux (x86_64) using readline 5.1