# apt fails with root privileges

**URL:** <https://forum.ansible.com/t/apt-fails-with-root-privileges/18586>\
**Category:** Ansible Project\
**Created:** [June 23, 2015, 9:18pm UTC](https://forum.ansible.com/t/apt-fails-with-root-privileges/18586 "2015-06-23T21:18:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamzeh\_alsalhi](https://avatars.discourse-cdn.com/v4/letter/h/65b543/32.png) [@hamzeh\_alsalhi](https://forum.ansible.com/u/hamzeh_alsalhi)\
**Post date:** [June 23, 2015, 9:18pm UTC](https://forum.ansible.com/t/apt-fails-with-root-privileges/18586/1 "2015-06-23T21:18:30Z")

</div>

When I try to run the command:

`

- name: update apt-get  
apt: update\_cache=yes

`

I get:

`

msg: Failed to lock apt for exclusive operation

`

Even though my users are configured

`

---

<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:** [June 26, 2015, 1:50pm UTC](https://forum.ansible.com/t/apt-fails-with-root-privileges/18586/2 "2015-06-26T13:50:30Z")

</div>

sudo\_user is the user you become, not the user executing sudo, remove  
it and it will default to root or set sudo\_user: root

I know this is confusing if you know about the sudo environment  
variables that is why we deprecated this syntax in favor of  
become\_user: in newer versions.
