# msg: \[Errno 2\] No such file or directory

**URL:** <https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244>\
**Category:** Ansible Project\
**Created:** [May 16, 2015, 6:10am UTC](https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244 "2015-05-16T06:10:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [May 16, 2015, 6:10am UTC](https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244/1 "2015-05-16T06:10:38Z")

</div>

Hi

I'm getting a "msg: [Errno 2] No such file or directory" on "apt" with the most simple playbook.

This is with version v1.9.1-1

I checked my syntax etc... and the only way I can fix it is to go to version v1.5.0. Googling, I see that this was an issue but it was fixed in 1.5.2.

Can there be something specific in my environment that causes this? A problem with sudo? Anybody else running into this?

Here is the full result:  
TASK: [baselinux | install important packages] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [tuck] =\> {"cmd": "DEBIAN\_FRONTEND=noninteractive DEBIAN\_PRIORITY=critical /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install tmux", "failed": true, "rc": 2}  
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed -- aborting

Is the issue that it tries to run 'DEBIAN\_FRONTEND"?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 16, 2015, 4:01pm UTC](https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244/2 "2015-05-16T16:01:16Z")

</div>

DEBIAN\_FRONTEND is just being set as an environment variable to tell  
apt not to prompt.

what OS are you running against? can you share the 'simple play'?

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [May 16, 2015, 4:34pm UTC](https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244/3 "2015-05-16T16:34:16Z")

</div>

> DEBIAN\_FRONTEND is just being set as an environment variable to tell  
> apt not to prompt.

I realise that, I knew you could do that with shell, but I hadn't realised it  
worked with cmd which I thought was a C exec of a binary command.

> what OS are you running against? can you share the 'simple play'?

Ubuntu 14.04, although, in an LXC container, but I can ssh into that  
container, and "sudo apt-get install tmux", and the sysctl module does work.  
As far as ansible is concerned, that container is just another Ubuntu machine:

main.yaml in role:  
&nbsp;&nbsp;&nbsp;&nbsp;- name: swappiness  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sysctl: name=vm.swappiness value=0 reload=yes checks=none

&nbsp;&nbsp;&nbsp;&nbsp;- name: install important packages  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apt: name=tmux

site.yaml  
&nbsp;&nbsp;&nbsp;&nbsp;- name: Apply base Linux config  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hosts: all  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gather\_facts: no  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo: yes  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remote\_user: yves

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;roles:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- baselinux

The command I use to run it:  
&nbsp;&nbsp;&nbsp;&nbsp;ansible-playbook --user yves -K site.yaml

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [May 16, 2015, 5:37pm UTC](https://forum.ansible.com/t/msg-errno-2-no-such-file-or-directory/18244/4 "2015-05-16T17:37:33Z")

</div>

Ok, solved, the issue was with submodules, I did:

git submodule update --init lib/ansible/modules/core  
git submodule update --init lib/ansible/modules/extras

and it works now. I think it was using the core modules from an old version.

I had not used ansible for a while, and had not re-read the doc, I see it now:

[http://docs.ansible.com/intro\_installation.html](http://docs.ansible.com/intro_installation.html)  
&nbsp;&nbsp;&nbsp;&nbsp;git pull --rebase  
&nbsp;&nbsp;&nbsp;&nbsp;git submodule update --init --recursive
