No match for argument: - CentOS

CentOS环境使用yum安装时报错:No match for argument: mysql80-community,Error: Unable to find a match。

Example

[root@localhost yum.repos.d]# yum repolist enabled | grep mysql
Last metadata expiration check: 0:17:28 ago on Mon 28 Oct 2019 01:01:44 AM EDT.
mysql-connectors-community           MySQL Connectors Community              28
mysql-tools-community                MySQL Tools Community                   12
mysql80-community                    MySQL 8.0 Community Server              21


[root@localhost nick]# sudo yum install mysql80-community
Last metadata expiration check: 0:04:38 ago on Mon 28 Oct 2019 01:01:44 AM EDT.
No match for argument: mysql80-community
Error: Unable to find a match

Resolved

[root@localhost nick]#sudo yum install mysql-community-server

使用ali mirror

CentOS

1、Backup repo files

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、 Download and save repo file.

Download the newest repo file CentOS-Base.repo and save it into directory /etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
or
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
or
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
or

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、Rebuild yum cache

Run command below to rebuild yum cache:

sudo yum makecache