RHEL8 和 CentOS安装Ansible时Problem: cannot install the best candidate for the job - nothing provides python3.9dist(ansible-core) needed by ansible-6.3.0-1.el8.noarch

问题

[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模块?!!!。

解决方法

以下方法是解决ansible2.9版本安装不上的问题。如果你要安装的是ansible新版本的话,你需要看ansible官网的安装手册了,最新版是通过python pip进行安装ansible的。

# 先安装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

结果图示

centos-release-ansible-29.noarch版本信息:

ansible版本信息:

资源

Alibaba Mirror镜像仓库源
Ansible官网最新版的文档

posted @ 2022-11-23 16:10  星小梦  阅读(5802)  评论(3)    收藏  举报