我是 dnf 新手,因此对于某些人来说这可能很明显。
我确实检查了 versionlock 并检查了 /etc/yum.repos.d 文件中是否存在排除行。但是,当我启用了任何其他存储库时,我找不到要安装的 mysql 服务器。我可以尝试在禁用所有其他存储库的情况下安装它,但这样就找不到所有依赖项。
[root@ip-10-9-10-242 yum.repos.d]# dnf clean all
42 files removed
[root@ip-10-9-10-242 yum.repos.d]# dnf --disablerepo "*" --enablerepo "mysql56-community" list available
Last metadata expiration check: 0:07:40 ago on Tue 30 Jul 2019 12:38:45 UTC.
Available Packages
mysql-community-bench.x86_64 5.6.45-2.el7 mysql56-community
...
mysql-community-server.x86_64 5.6.45-2.el7 mysql56-community
mysql-community-test.x86_64 5.6.45-2.el7 mysql56-community
[root@ip-10-9-10-242 yum.repos.d]# dnf --enablerepo "mysql56-community" search mysql-community-server.x86_64
Last metadata expiration check: 0:07:59 ago on Tue 30 Jul 2019 12:38:48 UTC.
No matches found.
[root@ip-10-9-10-242 yum.repos.d]# dnf search mysql-community
Last metadata expiration check: 0:10:57 ago on Tue 30 Jul 2019 12:38:48 UTC.
============================================================================================== Name Matched: mysql-community ==============================================================================================
mysql-community-bench.x86_64 : MySQL benchmark suite
mysql-community-release.noarch : MySQL repository configuration for yum
mysql-community-release.noarch : MySQL repository configuration for yum
mysql-community-embedded.i686 : MySQL embedded library
mysql-community-embedded.x86_64 : MySQL embedded library
mysql-community-embedded-devel.i686 : Development header files and libraries for MySQL as an embeddable library
mysql-community-embedded-devel.x86_64 : Development header files and libraries for MySQL as an embeddable library
因此,您可以看到在 mysql56 repo 中找到了一些东西(例如 bench),但没有找到服务器。我以前也做过:
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql56-community
并且可以看到:
[root@ip-10-9-10-242 yum.repos.d]# dnf repolist
Last metadata expiration check: 0:00:04 ago on Tue 30 Jul 2019 13:03:47 UTC.
repo id repo name status
mysql-connectors-community MySQL Connectors Community 118
mysql-tools-community MySQL Tools Community 95
mysql56-community MySQL 5.6 Community Server 169
rhui-client-config-server-8 Red Hat Update Infrastructure 3 Client C 3
rhui-rhel-8-appstream-rhui-rpms Red Hat Enterprise Linux 8 for x86_64 - 5,472
rhui-rhel-8-baseos-rhui-rpms Red Hat Enterprise Linux 8 for x86_64 - 2,029
对于仍然感到困惑的人来说,如果找不到,就无法安装。
[root@ip-10-9-10-242 ~]# dnf install mysql-community-server
Last metadata expiration check: 0:00:12 ago on Thu 01 Aug 2019 09:14:02 UTC.
No match for argument: mysql-community-server
Error: Unable to find a match
好的,所以执行一点“-v”操作,它显示包已被排除。但我可以禁用所有排除,它仍然显示它们已被排除。
[root@ip-10-9-10-242 dnf]# dnf repoquery --repo mysql56-community --available mysql-community-server-0:5.6.45-2.el7.x86_64
Last metadata expiration check: 0:13:17 ago on Thu 01 Aug 2019 17:12:25 UTC.
mysql-community-server-0:5.6.45-2.el7.x86_64
[root@ip-10-9-10-242 dnf]# dnf --enablerepo=mysql56-community --disableexcludepkgs all --disableexcludes all install mysql-community-bench
Last metadata expiration check: 0:14:46 ago on Thu 01 Aug 2019 17:13:30 UTC.
Error:
Problem: package mysql-community-bench-5.6.45-2.el7.x86_64 requires mysql-community-server(x86-64) >= 5.6.10, but none of the providers can be installed
- cannot install the best candidate for the job
- package mysql-community-server-5.6.15-4.el7.x86_64 is excluded
- package mysql-community-server-5.6.16-1.el7.x86_64 is excluded
.....
- package mysql-community-server-5.6.44-2.el7.x86_64 is excluded
- package mysql-community-server-5.6.45-2.el7.x86_64 is excluded
[root@ip-10-9-10-242 dnf]# dnf --disablerepo "*" --enablerepo=mysql56-community --disableexcludepkgs all --disableexcludes all install mysql-community-bench
Last metadata expiration check: 0:18:12 ago on Thu 01 Aug 2019 17:12:25 UTC.
Error:
Problem: cannot install the best candidate for the job
- nothing provides /usr/bin/perl needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(Getopt::Long) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(Data::Dumper) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(POSIX) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(Cwd) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(DBI) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(Benchmark) needed by mysql-community-bench-5.6.45-2.el7.x86_64
- nothing provides perl(sigtrap) needed by mysql-community-bench-5.6.45-2.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
答案1
对于那些来这里寻找解决方案的人,以下是在 RHEL8 上安装 MySQL 社区包的方法:https://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html。官方页面。罪魁祸首是默认的 mysql 模块。禁用它,dnf 就会找到社区包,没有问题。