# apt-get update fails

**URL:** <https://forum.ansible.com/t/apt-get-update-fails/17888>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [April 1, 2015, 9:56pm UTC](https://forum.ansible.com/t/apt-get-update-fails/17888 "2015-04-01T21:56:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Gertin](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tom\_Gertin](https://forum.ansible.com/u/Tom_Gertin)\
**Post date:** [April 1, 2015, 9:56pm UTC](https://forum.ansible.com/t/apt-get-update-fails/17888/1 "2015-04-01T21:56:05Z")

</div>

```auto
I am trying to run an 'apt-get update' command in my Ansible playbook but it is failing everytime. 

I am using the 'apt: update_cache=yes' command found here: http://docs.ansible.com/apt_module.html

It returns the following error:

TASK: [update apt cache] ****************************************************** 
failed: [localhost] => {"failed": true}
msg: Could not fetch updated apt files

FATAL: all hosts have already failed -- aborting

I created an Ubuntu trusty machine using virtualbox and I installed Ansible on it and I am running the scripts on the VirtualBox. My repo, which contains my Ansible scripts is here: https://github.com/d3netxer/ansible-osm-history-set-up

Thanks,

Tom

```

---

<div class="post-metadata">

**Author:** ![James\_Martin1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@James\_Martin1](https://forum.ansible.com/u/James_Martin1)\
**Post date:** [April 3, 2015, 6:30pm UTC](https://forum.ansible.com/t/apt-get-update-fails/17888/2 "2015-04-03T18:30:53Z")

</div>

Do the commands work when run by hand? Sounds like it could be a connectivity issue.

---

<div class="post-metadata">

**Author:** ![Matteo\_Scandolo](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matteo\_Scandolo](https://forum.ansible.com/u/Matteo_Scandolo)\
**Post date:** [April 14, 2015, 11:03am UTC](https://forum.ansible.com/t/apt-get-update-fails/17888/3 "2015-04-14T11:03:52Z")

</div>

Hi, I’m stucked with the same issue…

The command seems to work when runned by hand, but it exit whit this output:

`

W: Failed to fetch [http://repo.mongodb.org/apt/ubuntu/dists/utopic/mongodb-org/3.0/multiverse/binary-amd64/Packages](http://repo.mongodb.org/apt/ubuntu/dists/utopic/mongodb-org/3.0/multiverse/binary-amd64/Packages) 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

`

I think that it can be someway related to this. Am I right?

Thanks in advance
