我正在尝试在我的Ubuntu 18.04上安装ansible,它抛出了python依赖错误。我知道机器上默认安装的版本是3.x +。该依赖要求版本的python是2.x即2.7根据下面的日志结果,请建议我一个更好的选择来安装ansible或降级的python版本。
pawan@ubuntu:~/Devops$ sudo apt install -f ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ansible : Depends: python-jinja2 but it is not going to be installed
Depends: python-yaml but it is not going to be installed
Depends: python-paramiko but it is not going to be installed
Depends: python-httplib2 but it is not going to be installed
Depends: python-six but it is not going to be installed
Depends: python-crypto (>= 2.6) but it is not going to be installed
Depends: python-setuptools but it is not going to be installed
Depends: python-cryptography but it is not going to be installed
Depends: python:any (< 2.8)
Depends: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages.发布于 2020-08-07 16:53:15
我也有同样的问题,通过安装pip简单地解决了这个问题。
pip install --user ansible发布于 2019-07-30 05:48:26
我建议改用ansible的PPA,让它保持最新,它应该能够与ubuntu 18.04中的Python版本一起工作
sudo apt-add-repository ppa:ansible/ansible
sudo apt update && sudo apt -y install ansible以上命令将为您快速安装ansible。你也可以在这里看到Ansible在ubuntu上安装的官方文档,它反映了我的建议:https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-releases-via-apt-ubuntu
https://stackoverflow.com/questions/57258579
复制相似问题