在CentOS-8.5.2111-x86_64上安装ansible时出现问题



我需要在CentOS-8.5.2111-x86_64上安装ansible,但是我有一个错误

[root@ansible3 ~]# yum install ansible
Last metadata expiration check: 0:01:56 ago on Wed 07 Dec 2022 02:42:20 PM EET.
Error:
Problem: conflicting requests
- 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)

我已经完成的步骤

  1. 通过命令yum install -y epel-release第一次安装epel-release
  2. 然后通过yum install python3
  3. 安装python3
  4. 然后尝试用上面的命令安装ansible,错误是附加的

如果执行python3命令,提示符返回的是哪个Python版本?

更高可见版本需要Python3.9+。CentOS 8通常包含一个较低的python版本。

你可以尝试通过定位python3.9在机器上的实际安装位置来安装它,然后通过pip3模块安装它。

试题:

yum install python3-pip -y
python3 -m pip install ansible

可能会安装较低版本的Ansible。

最新更新