# apt install with version wildcards

**URL:** <https://forum.ansible.com/t/apt-install-with-version-wildcards/14313>\
**Category:** Ansible Project\
**Created:** [January 10, 2014, 10:55am UTC](https://forum.ansible.com/t/apt-install-with-version-wildcards/14313 "2014-01-10T10:55:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Zentgraf](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@David\_Zentgraf](https://forum.ansible.com/u/David_Zentgraf)\
**Post date:** [January 10, 2014, 10:55am UTC](https://forum.ansible.com/t/apt-install-with-version-wildcards/14313/1 "2014-01-10T10:55:57Z")

</div>

Hi,

I’m trying to use version wildcards while installing apt packages, like so:

apt: pkg=php5=5.4.\*

Since those packages are being updated in the repository, I cannot hardcode a precise version number. However, on some systems the default php5 package may not correspond to version 5.4, so I need to add a version restriction of some sort. Ansible does not seem to support this syntax, failing with “msg: pkgname wildcard and version can not be mixed”.

Is there any elegant solution to this?

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![Timur\_Batyrshin](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@Timur\_Batyrshin](https://forum.ansible.com/u/Timur_Batyrshin)\
**Post date:** [April 7, 2014, 4:51pm UTC](https://forum.ansible.com/t/apt-install-with-version-wildcards/14313/2 "2014-04-07T16:51:52Z")

</div>

Hi,

It looks like you can’t use both = and \* in the package name: [https://github.com/ansible/ansible/blob/devel/library/packaging/apt#L233-L235](https://github.com/ansible/ansible/blob/devel/library/packaging/apt#L233-L235)  
I’ve created [https://github.com/ansible/ansible/issues/6885](https://github.com/ansible/ansible/issues/6885) for that.

Cheers,  
Timur
