yum tries to downgrade a package (ensure => version)

1,048 views
Skip to first unread message

Jose Luis Ledesma

unread,
Feb 25, 2014, 5:07:06 AM2/25/14
to puppet...@googlegroups.com
Hi,

   I have found a problem trying to upgrade a rhel6 package (libcgroup), the current version installed is:

libcgroup-0.37-7.el6.x86_64

   And I want to install this version:

libcgroup-0.37-7.2.el6_4.x86_64

   So I created a class that states:

                package { 'libcgroup':
                  ensure => '0.37-7.2.el6_4',
                }

  But when I run puppet agent -t :

Error: Could not update: Failed to update to version 0.37-7.2.el6_4, got version 0.37-7.el6 instead
Error: /Stage[main]/Checks::Linux::Libcgroup/Package[libcgroup]/ensure: change from 0.37-7.el6 to 0.37-7.2.el6_4 failed: Could not update: Failed to update to version 0.37-7.2.el6_4, got version 0.37-7.el6 instead


   When I run the debug yum tries to downgrade the package:

Debug: Package[libcgroup](provider=yum): Downgrading package libcgroup from version 0.37-7.el6 to 0.37-7.2.el6_4
Debug: Executing '/usr/bin/yum -d 0 -e 0 -y downgrade libcgroup-0.37-7.2.el6_4'

   And obviously this package exists on the repo:


# yum install libcgroup-0.37-7.2.el6_4
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libcgroup.x86_64 0:0.37-7.el6 will be updated
--> Processing Dependency: libcgroup = 0.37-7.el6 for package: libcgroup-devel-0.37-7.el6.x86_64
---> Package libcgroup.x86_64 0:0.37-7.2.el6_4 will be an update
--> Running transaction check
---> Package libcgroup-devel.x86_64 0:0.37-7.el6 will be updated
---> Package libcgroup-devel.x86_64 0:0.37-7.2.el6_4 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                               Arch                         Version                                 Repository                  Size
=============================================================================================================================================
Updating:
 libcgroup                             x86_64                       0.37-7.2.el6_4                          rhel                       111 k
Updating for dependencies:
 libcgroup-devel                       x86_64                       0.37-7.2.el6_4                          rhel                        35 k

Transaction Summary
=============================================================================================================================================
Upgrade       2 Package(s)


If I set "ensure => latest" in the package definition it works.

any hint?

jcbollinger

unread,
Feb 25, 2014, 9:51:20 AM2/25/14
to puppet...@googlegroups.com


This looks like a Puppet bug (probably https://tickets.puppetlabs.com/browse/PUP-682, or at least related to that).  Note in particular that Puppet thinks it needs to downgrade the installed package version, and that it issues a yum command appropriate for that purpose.  Yum understands RPM version-release codes differently than Puppet seems to do, and recognizes the specified package version as an update, which it therefore refuses to apply as a downgrade.  In the end, the original package remains installed.

Per comments in JIRA, work addressing the general issue is being performed in the context of https://tickets.puppetlabs.com/browse/PUP-1244.  You could consider commenting on the issue.

In the meantime, your best workaround is probably to ensure 'latest'.  If you have your nodes pointed at an internal repository (which I would recommend in any case) then you can control what version is available for installation be controlling what packages are in that repository.


John

Reply all
Reply to author
Forward
0 new messages