# apt-get autoremove - how to use it and how to check that it is doing what it should ?

**URL:** <https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [January 3, 2016, 1:50pm UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109 "2016-01-03T13:50:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_Pascoe](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@Wayne\_Pascoe](https://forum.ansible.com/u/Wayne_Pascoe)\
**Post date:** [January 3, 2016, 1:50pm UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109/1 "2016-01-03T13:50:45Z")

</div>

Hi all,

I’m trying to create some simple playbooks to manage a few hosts. One of the tasks I’m trying to complete is to autoremove unneeded packages. I’m using Ansible 2.1.0 on Ubuntu 14.04 (control machine and managed hosts).

I started with the following playbook:

`

---

<div class="post-metadata">

**Author:** ![Par\_Berge](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@Par\_Berge](https://forum.ansible.com/u/Par_Berge)\
**Post date:** [January 5, 2016, 8:36am UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109/2 "2016-01-05T08:36:12Z")

</div>

Hi,

I would use command (or shell) until it’s implemented in apt module.  
Here is the feature request issue ticket:  
[https://github.com/ansible/ansible-modules-core/issues/965](https://github.com/ansible/ansible-modules-core/issues/965)

---

<div class="post-metadata">

**Author:** ![Mischa\_ter\_Smitten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mischa\_ter\_Smitten](https://forum.ansible.com/u/Mischa_ter_Smitten)\
**Post date:** [January 5, 2016, 7:16pm UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109/3 "2016-01-05T19:16:26Z")

</div>

It’s implemented in [this role](https://github.com/Oefenweb/ansible-apt).

---

<div class="post-metadata">

**Author:** ![Wayne\_Pascoe](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@Wayne\_Pascoe](https://forum.ansible.com/u/Wayne_Pascoe)\
**Post date:** [January 5, 2016, 7:30pm UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109/4 "2016-01-05T19:30:22Z")

</div>

Thanks,

Is there any way to supress the error on this particular play until then ?

---

<div class="post-metadata">

**Author:** ![Wayne\_Pascoe](https://avatars.discourse-cdn.com/v4/letter/w/919ad9/32.png) [@Wayne\_Pascoe](https://forum.ansible.com/u/Wayne_Pascoe)\
**Post date:** [January 5, 2016, 7:30pm UTC](https://forum.ansible.com/t/apt-get-autoremove-how-to-use-it-and-how-to-check-that-it-is-doing-what-it-should/20109/5 "2016-01-05T19:30:59Z")

</div>

Thanks - I’m trying to avoid pulling in an entire role if I can help it, so the shell play looks simpler for now.
