# Using yum module to install/update to defined version of a package-X.

**URL:** <https://forum.ansible.com/t/using-yum-module-to-install-update-to-defined-version-of-a-package-x/25561>\
**Category:** Ansible Project\
**Created:** [September 21, 2017, 4:55pm UTC](https://forum.ansible.com/t/using-yum-module-to-install-update-to-defined-version-of-a-package-x/25561 "2017-09-21T16:55:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rui\_Goncalves](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@Rui\_Goncalves](https://forum.ansible.com/u/Rui_Goncalves)\
**Post date:** [September 21, 2017, 4:55pm UTC](https://forum.ansible.com/t/using-yum-module-to-install-update-to-defined-version-of-a-package-x/25561/1 "2017-09-21T16:55:03Z")

</div>

Hi all.

I’d like to install or update a package specifying the major.minor version. I.e, upgrade only if there’s a bugfix package available. I’ve tried using state= **latest** and **present** , but does not work as I expected.

Using: yum: name=nginx-debuginfo-1.6\* state=latest

> Suffix “-1.6\*” is ignored, and version nginx-debuginfo-1.10 (which is the latest available version on the repo) gets installed. I want to remain on 1.6.\* version.

Using: yum: name=nginx-debuginfo-1.6\* state=present

> If the host already contains nginx-debuginfo-1.6.1 installed and there’s a new version nginx-debuginfo-1.6.2 available on the repo, the package is not updated.

Any idea how can I achieve the desired result.

Thanks.  
Rui

---

<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:** [September 22, 2017, 7:30am UTC](https://forum.ansible.com/t/using-yum-module-to-install-update-to-defined-version-of-a-package-x/25561/2 "2017-09-22T07:30:43Z")

</div>

As you have experienced yum doesn't support this, you should look into yum versionlock.

---

<div class="post-metadata">

**Author:** ![Rui\_Goncalves](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@Rui\_Goncalves](https://forum.ansible.com/u/Rui_Goncalves)\
**Post date:** [September 22, 2017, 8:01am UTC](https://forum.ansible.com/t/using-yum-module-to-install-update-to-defined-version-of-a-package-x/25561/3 "2017-09-22T08:01:11Z")

</div>

Thanks Kai.
