# Apt Update exclude Packages (Blacklist)

**URL:** <https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861>\
**Category:** Ansible Project\
**Created:** [March 11, 2019, 12:57pm UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861 "2019-03-11T12:57:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Face\_Gaming](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@Face\_Gaming](https://forum.ansible.com/u/Face_Gaming)\
**Post date:** [March 11, 2019, 12:57pm UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861/1 "2019-03-11T12:57:11Z")

</div>

Hey Guys

I would like to know, if its possible to exclude packages from an apt update or a blacklist for packages, which shouldn’t be updated.

Thanks for your help!

Greetings

---

<div class="post-metadata">

**Author:** ![Luca\_Cazzaniga](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@Luca\_Cazzaniga](https://forum.ansible.com/u/Luca_Cazzaniga)\
**Post date:** [March 11, 2019, 5:20pm UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861/2 "2019-03-11T17:20:54Z")

</div>

Hi, for yum there's the parameter exclude, for apt see a pinning howto  
for example [https://wiki.debian.org/AptPreferences](https://wiki.debian.org/AptPreferences), so you can use  
lineinfile module to set the pinning priority of the package

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 11, 2019, 5:27pm UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861/3 "2019-03-11T17:27:20Z")

</div>

There is no module for it, but you can run "apt-mark hold" with the command or shell module.

---

<div class="post-metadata">

**Author:** ![Face\_Gaming](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@Face\_Gaming](https://forum.ansible.com/u/Face_Gaming)\
**Post date:** [March 12, 2019, 8:47am UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861/4 "2019-03-12T08:47:37Z")

</div>

Hey Thanks for your quick Answer. I will definitely try that and see how this works

---

<div class="post-metadata">

**Author:** ![Face\_Gaming](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@Face\_Gaming](https://forum.ansible.com/u/Face_Gaming)\
**Post date:** [March 12, 2019, 8:50am UTC](https://forum.ansible.com/t/apt-update-exclude-packages-blacklist/29861/5 "2019-03-12T08:50:51Z")

</div>

Hey, i will use this as a second option.  
Thanks for your Answer!
