# Ansible hangs indefinitely when trying to sudo apt-get install on Ubuntu machine

**URL:** <https://forum.ansible.com/t/ansible-hangs-indefinitely-when-trying-to-sudo-apt-get-install-on-ubuntu-machine/22631>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [September 23, 2016, 5:34pm UTC](https://forum.ansible.com/t/ansible-hangs-indefinitely-when-trying-to-sudo-apt-get-install-on-ubuntu-machine/22631 "2016-09-23T17:34:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![H\_Cui](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@H\_Cui](https://forum.ansible.com/u/H_Cui)\
**Post date:** [September 23, 2016, 5:34pm UTC](https://forum.ansible.com/t/ansible-hangs-indefinitely-when-trying-to-sudo-apt-get-install-on-ubuntu-machine/22631/1 "2016-09-23T17:34:52Z")

</div>

Hello, I’m testing an Ansible playbook and kept getting this indefinite hangs on sudo apt-get install command Ubuntu machine, I’m using Ansible version 1.4.8. server and client are both Ubuntu 14.04 since currently I’m using my own IP address to test provisioning to myself on a fresh machine. The exact code, hanging part and -vvvv info are as follows:

**the exact code in my tasks main.yml:**

---

<div class="post-metadata">

**Author:** ![H\_Cui](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@H\_Cui](https://forum.ansible.com/u/H_Cui)\
**Post date:** [September 23, 2016, 5:51pm UTC](https://forum.ansible.com/t/ansible-hangs-indefinitely-when-trying-to-sudo-apt-get-install-on-ubuntu-machine/22631/2 "2016-09-23T17:51:36Z")

</div>

Correction: The Ansible version is 1.5.4. Sorry I was being careless

在 2016年9月23日星期五 UTC-7上午10:37:03，H Cui写道：
