首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于Ubuntu 18.04上的python依赖,无法安装ansible

由于Ubuntu 18.04上的python依赖,无法安装ansible
EN

Stack Overflow用户
提问于 2019-07-30 01:16:02
回答 2查看 4K关注 0票数 8

我正在尝试在我的Ubuntu 18.04上安装ansible,它抛出了python依赖错误。我知道机器上默认安装的版本是3.x +。该依赖要求版本的python是2.x即2.7根据下面的日志结果,请建议我一个更好的选择来安装ansible或降级的python版本。

代码语言:javascript
复制
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.
EN

回答 2

Stack Overflow用户

发布于 2020-08-07 16:53:15

我也有同样的问题,通过安装pip简单地解决了这个问题。

代码语言:javascript
复制
pip install --user ansible
票数 1
EN

Stack Overflow用户

发布于 2019-07-30 05:48:26

我建议改用ansible的PPA,让它保持最新,它应该能够与ubuntu 18.04中的Python版本一起工作

代码语言:javascript
复制
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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57258579

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档