# Getting failed to lock apt for exclusive operation on a playbook using roles. Not sure if I'm doing this right.

**URL:** <https://forum.ansible.com/t/getting-failed-to-lock-apt-for-exclusive-operation-on-a-playbook-using-roles-not-sure-if-im-doing-this-right/19530>\
**Category:** Ansible Project\
**Created:** [October 16, 2015, 6:44pm UTC](https://forum.ansible.com/t/getting-failed-to-lock-apt-for-exclusive-operation-on-a-playbook-using-roles-not-sure-if-im-doing-this-right/19530 "2015-10-16T18:44:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Risa](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@Risa](https://forum.ansible.com/u/Risa)\
**Post date:** [October 16, 2015, 6:44pm UTC](https://forum.ansible.com/t/getting-failed-to-lock-apt-for-exclusive-operation-on-a-playbook-using-roles-not-sure-if-im-doing-this-right/19530/1 "2015-10-16T18:44:08Z")

</div>

While I’m learning Ansible, I started on my first role, which is to do a simple sudo apt-get update and upgrade.

As a flat file, this works:
