我在 Centos 7 上安装 MariaDB 10.4 时遇到一些问题。官方玛丽亚数据库指南表示MariaDB.repo
应创建一个新的存储库文件/etc/yum.repos.d/
,其中包含以下内容:
# MariaDB 10.4 CentOS repository list - created 2019-12-13 22:03 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-ppc64le
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
我已经运行yum-config-manager --enable MariaDB.repo
并yum update
检查了启用的存储库:
$ enabled | grep maria
mariadb MariaDB 86
这确认新的存储库已启用。后来导游说跑sudo yum install MariaDB-server MariaDB-client
。不幸的是,没有什么可安装的,因为我收到一条消息:
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.anexia.at
* epel: ftp.uni-kl.de
* extras: mirror.easyname.at
* remi-php74: remi.mirror.karneval.cz
* remi-safe: remi.mirror.karneval.cz
* updates: centos.anexia.at
No package MariaDB-server available.
* Maybe you meant: mariadb-server
No package MariaDB-client available.
请注意,没有提及MariaDB.repo
我刚刚启用。另外,建议的软件包mariadb-server
是版本 5.5。在 Centos 7 上安装 MariaDB 10.4 版的正确方法是什么?
答案1
我认为您在 MariaDB 存储库配置工具中选择了错误的 cpu 架构。
我已经在具有 Intel cpu 的 CentOS 7 和您发布的 MariaDB.repo 中进行了测试,其行为如您所说,但如果我为 Intel (x86_64) 配置存储库,则在执行时会正确安装
yum install MariaDB-server
输出是
# yum install MariaDB-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.uvigo.es
* extras: centos.uvigo.es
* updates: centos.uvigo.es
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.4.11-1.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================
Installing:
MariaDB-server x86_64 10.4.11-1.el7.centos mariadb 26 M
如果 cpu 选择正确,我不知道会发生什么,而且我没有 ppc64le 架构的系统可供测试。
答案2
baseurl = http://yum.mariadb.org/10.4/centos7-ppc64le
https://en.wikipedia.org/wiki/Ppc64
简单来说,如果你使用PC而不是IBM硬件,那么CPU架构是错误的。我猜你想要 x86_64 / amd64,所以检查一下http://yum.mariadb.org/10.4/centos7-amd64/