yum无法在CentoOS 7上资助Mariadb Package

时间:2019-12-23 08:57:58

标签: centos package mariadb centos7 yum

我尝试安装MariaDB

$ sudo yum -y install MariaDB-server MariaDB-client

但是百胜返回错误

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.halifax.rwth-aachen.de
 * epel: mirror.imt-systems.com
 * extras: mirror.imt-systems.com
 * remi-php72: mirror.23media.com
 * remi-safe: mirror.23media.com
 * updates: mirror.alpix.eu
No package MariaDB-server available.
No package MariaDB-client available.
Error: Nothing to do

我还在/etc/yum.repos.d/MariaDB.repo中添加了Mariadb存储库 MariaDB.repo是:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2 个答案:

答案 0 :(得分:1)

.repo中的

http://yum.mariadb.org/5.5/centos6-amd64与CentOS 7不匹配,而是:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos7-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

然后:

sudo yum clean all
sudo yum update
sudo yum -y install MariaDB-server MariaDB-client

答案 1 :(得分:0)

要匹配区分大小写的服务器名称,即 MariaDB-server 而不是 mariadb-server,您必须添加了正确的 mariadb 服务器存储库。因此 - 您还将拥有最新的 Maria DB 服务器版本(如果不是有意的,请注意这一点)。

对于值得使用官方安装手册的 Centos 7 版本 - 更安全和简单:https://mariadb.com/resources/blog/installing-mariadb-10-on-centos-7-rhel-7/

$ cd ~
$ sudo yum install wget
$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
$ chmod +x mariadb_repo_setup
$ sudo ./mariadb_repo_setup
$
$ # Installation
$ sudo yum install MariaDB-server