# How to check if any package is installed on remote system ?

**URL:** <https://forum.ansible.com/t/how-to-check-if-any-package-is-installed-on-remote-system/21968>\
**Category:** Ansible Project\
**Created:** [July 9, 2016, 9:52am UTC](https://forum.ansible.com/t/how-to-check-if-any-package-is-installed-on-remote-system/21968 "2016-07-09T09:52:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Bandarkar](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@Pratik\_Bandarkar](https://forum.ansible.com/u/Pratik_Bandarkar)\
**Post date:** [July 9, 2016, 9:52am UTC](https://forum.ansible.com/t/how-to-check-if-any-package-is-installed-on-remote-system/21968/1 "2016-07-09T09:52:03Z")

</div>

Hi,

I am looking for some option in yum module to check if any specific package is installed or not ? Can anyone help me on the same.

Regards,  
Pratik.

---

<div class="post-metadata">

**Author:** ![Nico](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@Nico](https://forum.ansible.com/u/Nico)\
**Post date:** [July 11, 2016, 12:09am UTC](https://forum.ansible.com/t/how-to-check-if-any-package-is-installed-on-remote-system/21968/2 "2016-07-11T00:09:09Z")

</div>

Hi,

It depend on what you want to achieve, the yum module can check if a package is installed or not then install or remove using the state parameter.  
However if you just want to check if a package is installed or not then something like this post:  
[http://stackoverflow.com/questions/21892603/how-to-make-ansible-execute-a-shell-script-if-a-package-is-not-installed](http://stackoverflow.com/questions/21892603/how-to-make-ansible-execute-a-shell-script-if-a-package-is-not-installed)

but for yum the command would probably be: yum list installed

-Nico
