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

37 views
Skip to first unread message

Rui Goncalves

unread,
Sep 21, 2017, 12:55:03 PM9/21/17
to Ansible Project
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

Kai Stian Olstad

unread,
Sep 22, 2017, 3:30:56 AM9/22/17
to ansible...@googlegroups.com
On 21.09.2017 18:55, Rui Goncalves wrote:
> 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.

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


--
Kai Stian Olstad

Rui Goncalves

unread,
Sep 22, 2017, 4:01:12 AM9/22/17
to Ansible Project
Thanks Kai.
Reply all
Reply to author
Forward
0 new messages