abhinav@ubuntu:~$ sudo apt-get install 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: sshpass but it is not installable
E: Unable to correct problems, you have held broken packages.
答案1
我猜你考虑过安装指南docs.ansible.com
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt-get install ansible
Ubuntu 18.04 LTS 现在将返回,sshpass
无法安装。
为了解决这个问题,你需要添加通用存储库,它是Ubuntu 的主要存储库之一:
- 主要 - Canonical 支持的免费开源软件。
- Universe - 社区维护的免费开源软件。
- 受限 - 设备的专有驱动程序。
- Multiverse——受版权或法律问题限制的软件。
通过终端执行此操作:
$ sudo add-apt-repository universe
$ sudo apt-get update
最后,重新运行命令来安装 Ansible 包:
$ sudo apt-get install ansible
$ ansible --version
ansible 2.7.0