# Packages marked for installation on aptitude after removing from ansible

**URL:** <https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767>\
**Category:** Ansible Project\
**Created:** [October 25, 2013, 3:43am UTC](https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767 "2013-10-25T03:43:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Fink\_Grael](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@Felipe\_Fink\_Grael](https://forum.ansible.com/u/Felipe_Fink_Grael)\
**Post date:** [October 25, 2013, 3:43am UTC](https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767/1 "2013-10-25T03:43:51Z")

</div>

Hi,

I am uninstalling several packages with the apt module, explicitly marking them as purged, as seen on the snippet below. Ansible successfully removes these packages. However, when I log into the machine and open aptitude, these packages are purged but marked for installation. Is there a way to prevent this?

- name: Ensure several blacklisted packages are uninstalled  
apt: pkg={{ item }} state=absent purge=yes  
with\_items:
- gnash
- browser-plugin-gnash

(…)

Cheers,  
Felipe

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 25, 2013, 11:42pm UTC](https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767/2 "2013-10-25T23:42:15Z")

</div>

Can you elaborate on what commands you ran to show that they were “marked for installation”?

(Also, version of ansible you are using?)

Thanks!

---

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [October 27, 2013, 4:10am UTC](https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767/3 "2013-10-27T04:10:53Z")

</div>

Hi Felipe,

I’ve this happen within the last month on the command line of a system ansible had never touched. Things were a bit crazy at the time, so I may not describe the situation quite right…but it was _something along the lines_ of I wanted postfix instead of sendmail, or rsyslog instead of sysklogd. When I would install what I wanted, apt-get would automatically remove the other package as a mutual exclusion or “alternate”. I spent a few moments trying to avoid this auto-swap (why, escapes me) with “apt-get purge -y ^sendmail\*” followed by “apt-get install -y postfix”.

That worked…but when I fried up aptitude later it tried to revert the changes of both commands. Once I got it (re)sorted and happy, I just started letting it have its way on the mutual exclusions.

So my advice would be to try repeating on the command line what you’ve got in the playbook, as you might find aptitude still does this. (I do remember though, for certain, that in my case the purge was not enough… I had to also install one of the recently purged package’s alternates to make aptitude mad)

HTH,  
Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [October 27, 2013, 4:13am UTC](https://forum.ansible.com/t/packages-marked-for-installation-on-aptitude-after-removing-from-ansible/13767/4 "2013-10-27T04:13:10Z")

</div>

Hehe…fried aptitude…

\*when I **fired up**
