在Ubuntu 18.04 LTS上安装特定版本的Ansible(2.3.1.0)

在Ubuntu 18.04 LTS上安装特定版本的Ansible(2.3.1.0),ubuntu,packaging,debian-based,Ubuntu,Packaging,Debian Based,我想在Ubuntu 18.04上安装Ansible 2.3.1.0 当我运行apt get install ansible时,它会安装版本2.5.3 下面是apt缓存策略ansible的输出。之后,我删除了安装 ansible: Installed: (none) Candidate: 2.5.3-1ppa~bionic Version table: 2.5.3-1ppa~bionic 500 500 http://ppa.launchpad.net/ans

我想在Ubuntu 18.04上安装Ansible 2.3.1.0

当我运行apt get install ansible时,它会安装版本2.5.3

下面是
apt缓存策略ansible
的输出。之后,我删除了安装

ansible:
  Installed: (none)
  Candidate: 2.5.3-1ppa~bionic
  Version table:
     2.5.3-1ppa~bionic 500
        500 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main amd64 Packages
        500 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main i386 Packages
     2.5.1+dfsg-1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

您可以尝试使用
python-pip
,首先使用
apt
安装
python-pip

sudo apt-get install python-pip python-dev
然后使用
pip
安装所需的python版本:

sudo -H pip install ansible==2.3.3.0
以下是回答此问题时Ansible版本的完整列表:

from versions: 1.0, 1.1, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3,  
1.3.4, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4,  
1.5.5, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8,1.6.9, 1.6.10,  
1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.9.0.1,1.9.1, 1.9.2, 1.9.3,  
1.9.4, 1.9.5, 1.9.6, 2.0.0.0, 2.0.0.1, 2.0.0.2, 2.0.1.0, 2.0.2.0, 2.1.0.0, 2.1.1.0,  
2.1.2.0, 2.1.3.0, 2.1.4.0, 2.1.5.0, 2.1.6.0, 2.2.0.0,2.2.1.0, 2.2.2.0, 2.2.3.0,  
2.3.0.0, 2.3.1.0, 2.3.2.0, 2.3.3.0, 2.4.0.0, 2.4.1.0, 2.4.2.0, 2.4.3.0, 2.4.4.0,  
2.5.0a1, 2.5.0b1, 2.5.0b2, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0a1)

这使我从2.7.11恢复到2.7.9

步骤1:sudo apt缓存策略ansible

[ubuntu@ip-10-0-0-36 ~]$ sudo apt-cache policy ansible
ansible:
  Installed: 2.5.1+dfsg-1
  Candidate: 2.7.10-1ppa~bionic
  Version table:
     2.7.10-1ppa~bionic 500
        500 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main amd64 Packages
 *** 2.5.1+dfsg-1 500
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
步骤2:sudo apt get install ansible=2.5.1+dfsg-1

[ubuntu@ip-10-0-0-36 ~]$ sudo apt-get install ansible=2.5.1+dfsg-1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Setting up python-lockfile (1:0.12.2-2) ...
Setting up python-jinja2 (2.10-1) ...
Setting up ansible (2.5.1+dfsg-1) ...
Setting up python-libcloud (2.2.1-1) ..
步骤3:验证已安装的版本

ubuntu@ip-10-0-0-36 ~]$ ansible --version
ansible 2.7.9
  config file = /etc/ansible/ansible.cfg

我最近要求在一台干净的机器上安装2.7版,并在确定正确的ppa后使用以下方法进行安装:

sudo add-apt-repository --update ppa:ansible/ansible-2.7
sudo apt install ansible
我在Mint 19上(基于Ubuntu 18.04),基本上@haymansfield的回答让我感到了些许不同:

sudo apt update
sudo add-apt-repository ppa:ansible/ansible-2.9
sudo apt install ansible


--update
标志对此操作系统未知。

您可能读错了文章
sudo apt get install package=version
可能的副本您也可以通过PIPIP安装ansible可能的副本谢谢各位。。这很有帮助