# Why does the apt module remove hold on packages!?

**URL:** <https://forum.ansible.com/t/why-does-the-apt-module-remove-hold-on-packages/34807>\
**Category:** Ansible Project\
**Created:** [March 19, 2021, 8:41am UTC](https://forum.ansible.com/t/why-does-the-apt-module-remove-hold-on-packages/34807 "2021-03-19T08:41:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goran](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Goran](https://forum.ansible.com/u/Goran)\
**Post date:** [March 19, 2021, 8:41am UTC](https://forum.ansible.com/t/why-does-the-apt-module-remove-hold-on-packages/34807/1 "2021-03-19T08:41:43Z")

</div>

I have a playbook that starts out with a task that holds a number of packages on debian machines relating to postgres and java stuff, and that part works well… I know that for sure.

And then when I perform a general upgrade of the debian serrver in a later task, the apt module seem to remove my holds on the packages. Is there anyway to prevent this unwanted behaviour?

- name: Install updates on Debian  
apt:  
update\_cache: yes  
cache\_valid\_time: 10  
upgrade: safe  
when:
- ansible\_os\_family == “Debian”

Kind regards,

Goran

---

<div class="post-metadata">

**Author:** ![Goran](https://avatars.discourse-cdn.com/v4/letter/g/a6a055/32.png) [@Goran](https://forum.ansible.com/u/Goran)\
**Post date:** [March 19, 2021, 9:16am UTC](https://forum.ansible.com/t/why-does-the-apt-module-remove-hold-on-packages/34807/2 "2021-03-19T09:16:50Z")

</div>

I ran across this option _ **"force\_apt\_get: yes** _" - and that actually seems to have solved my problem.

I still wonder - if this behaviour is due to ansible using aptitude in stead of apt-get, why would any upgrade commnand cancel holds unless you are doing an dist-upgrade?  
And also what is the rationale for changing important behaviour like this - especially without big warning signs in bright neon colors?

It has worked well - with apt module upgrades respecting and retaining holds- until ansible 2.6 at least. As far as I know, at least.
