问题
[root@localhost yum.repos.d]# yum install ansible -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository AppStream is listed more than once in the configuration
Last metadata expiration check: 0:01:54 ago on Wed 23 Nov 2022 02:37:19 AM EST.
Error:
Problem: cannot install the best candidate for the job
- nothing provides python3.9dist(ansible-core) needed by ansible-6.3.0-1.el8.noarch
- nothing provides (python3.9dist(ansible-core) >= 2.13.3 with python3.9dist(ansible-core) < 2.14) needed by ansible-6.3.0-1.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
nothing provides python3.9dist(ansible-core) needed by ansible-6.3.0-1.el8.noarch
不理解这什么玩意,难道是说python3.9dist中的ansible-core模块?!!!。
解决
# 先安装CentOS源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
# 安装来自CentOS ConfigManagement SIG存储库的Ansible 2.9包
dnf install centos-release-ansible-29.noarch
# 安装Ansible
dnf install ansible