Overview
The new version of Ansible has to be installed with PIP. This means the old version of Ansible has to be removed by the Ubuntu package manager, apt
.
Remove Old Version of Ansible
Used the package manager to remove the old version of Ansible:
sudo apt -y remove ansible
The output ends with:
Successfully uninstalled ansible-2.9.2
Install New Version of Ansible
Used PIP to install the new version of Ansible:
sudo pip3 install ansible
The output was:
The directory '/home/douglas/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/douglas/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting ansible Downloading https://files.pythonhosted.org/packages/4a/0b/44b586965bd51135d3915a02d1327fb392843630435cd41d6c89898c5f24/ansible-2.10.0.tar.gz (25.5MB) 100% |████████████████████████████████| 25.5MB 58kB/s Collecting ansible-base<2.11,>=2.10.1 (from ansible) Downloading https://files.pythonhosted.org/packages/0f/84/88f33c9d4a5eda7f4183500996c2504b76f5312d57f00e5981da0b73b4af/ansible-base-2.10.1.tar.gz (6.0MB) 100% |████████████████████████████████| 6.0MB 198kB/s Requirement already satisfied: PyYAML in /home/douglas/.local/lib/python3.6/site-packages (from ansible-base<2.11,>=2.10.1->ansible) Requirement already satisfied: cryptography in /home/douglas/.local/lib/python3.6/site-packages (from ansible-base<2.11,>=2.10.1->ansible) Requirement already satisfied: jinja2 in /home/douglas/.local/lib/python3.6/site-packages (from ansible-base<2.11,>=2.10.1->ansible) Collecting packaging (from ansible-base<2.11,>=2.10.1->ansible) Downloading https://files.pythonhosted.org/packages/46/19/c5ab91b1b05cfe63cccd5cfc971db9214c6dd6ced54e33c30d5af1d2bc43/packaging-20.4-py2.py3-none-any.whl Requirement already satisfied: six>=1.4.1 in /home/douglas/.local/lib/python3.6/site-packages (from cryptography->ansible-base<2.11,>=2.10.1->ansible) Requirement already satisfied: cffi!=1.11.3,>=1.8 in /home/douglas/.local/lib/python3.6/site-packages (from cryptography->ansible-base<2.11,>=2.10.1->ansible) Requirement already satisfied: MarkupSafe>=0.23 in /home/douglas/.local/lib/python3.6/site-packages (from jinja2->ansible-base<2.11,>=2.10.1->ansible) Collecting pyparsing>=2.0.2 (from packaging->ansible-base<2.11,>=2.10.1->ansible) Downloading https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67kB) 100% |████████████████████████████████| 71kB 874kB/s Requirement already satisfied: pycparser in /home/douglas/.local/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.8->cryptography->ansible-base<2.11,>=2.10.1->ansible) Installing collected packages: pyparsing, packaging, ansible-base, ansible Running setup.py install for ansible-base ... done Running setup.py install for ansible ... done Successfully installed ansible-2.10.0 ansible-base-2.10.1 packaging-20.4 pyparsing-2.4.7
Verify New Version
Verify the new version of Ansible:
ansible --version
The output was:
ansible 2.10.1 config file = /etc/ansible/ansible-ocm12c/ansible.cfg configured module search path = ['/home/douglas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible executable location = /usr/local/bin/ansible python version = 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0]