在旧版 RedHat 7 中安装 ansible

在旧版 RedHat 7 中安装 ansible

我正在尝试在旧 RedHat 中安装 Ansible。我已经使用 yum 更新了所有软件包。

> sudo yum install ansible
Loaded plugins: product-id, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.8.4-1.el7 will be installed
--> Processing Dependency: PyYAML for package: ansible-2.8.4-1.el7.noarch
--> Processing Dependency: python-httplib2 for package: ansible-2.8.4-1.el7.noarch
--> Processing Dependency: python-jinja2 for package: ansible-2.8.4-1.el7.noarch
--> Processing Dependency: python-paramiko for package: ansible-2.8.4-1.el7.noarch
--> Processing Dependency: python2-cryptography for package: ansible-2.8.4-1.el7.noarch
--> Processing Dependency: python2-jmespath for package: ansible-2.8.4-1.el7.noarch
--> Running transaction check
---> Package PyYAML.x86_64 0:3.10-11.el7 will be installed
--> Processing Dependency: libyaml-0.so.2()(64bit) for package: PyYAML-3.10-11.el7.x86_64
---> Package ansible.noarch 0:2.8.4-1.el7 will be installed
--> Processing Dependency: python2-cryptography for package: ansible-2.8.4-1.el7.noarch
---> Package python-httplib2.noarch 0:0.9.2-0.2.el7 will be installed
---> Package python-jinja2.noarch 0:2.8-7.rhel7 will be installed
--> Processing Dependency: python-babel >= 0.8 for package: python-jinja2-2.8-7.rhel7.noarch
--> Processing Dependency: python-markupsafe for package: python-jinja2-2.8-7.rhel7.noarch
---> Package python-paramiko.noarch 0:2.1.1-0.10.el7 will be installed
--> Processing Dependency: python2-pyasn1 for package: python-paramiko-2.1.1-0.10.el7.noarch
---> Package python2-jmespath.noarch 0:0.9.0-1.el7 will be installed
--> Running transaction check
---> Package ansible.noarch 0:2.8.4-1.el7 will be installed
--> Processing Dependency: python2-cryptography for package: ansible-2.8.4-1.el7.noarch
---> Package libyaml.x86_64 0:0.1.4-11.el7_0 will be installed
---> Package python-babel.noarch 0:0.9.6-8.el7 will be installed
---> Package python-markupsafe.x86_64 0:0.11-10.el7 will be installed
---> Package python-paramiko.noarch 0:2.1.1-0.10.el7 will be installed
--> Processing Dependency: python2-pyasn1 for package: python-paramiko-2.1.1-0.10.el7.noarch
--> Finished Dependency Resolution
Error: Package: ansible-2.8.4-1.el7.noarch (epel)
           Requires: python2-cryptography
Error: Package: python-paramiko-2.1.1-0.10.el7.noarch (epel)
           Requires: python2-pyasn1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

检查安装了哪个版本的 Python:

python --version
Python 2.7.5

我该如何修复这个问题?

答案1

首先尝试在 yum repo 中搜索

yum search python | egrep  "pyasn|cryptography"

通过这种方式,您将在 repo 中搜索您需要的软件包。

如果未列出,那么您可以尝试添加epelrepos 和centos-extrarepo。

相关内容