Jira (PUP-5539) circular dependent RPM packages can't be uninstalled

3 views
Skip to first unread message

Wouter Verhelst (JIRA)

unread,
Nov 23, 2015, 7:38:03 AM11/23/15
to puppe...@googlegroups.com
Wouter Verhelst created an issue
 
Puppet / Bug PUP-5539
circular dependent RPM packages can't be uninstalled
Issue Type: Bug Bug
Affects Versions: PUP 3.7.2, PUP 2.7.25
Assignee: Unassigned
Created: 2015/11/23 4:37 AM
Environment:

puppet master on Debian jessie, with Debian's packaged version of puppet using mod_passenger.

puppet client on CentOS 6.7, with puppet RPM packages from EPEL (2.7.26).

Priority: Normal Normal
Reporter: Wouter Verhelst

With the following manifest snippet:

{{
class gui {
$packages_unwanted = [
"gnome-media",
"gnome-media-libs",
]

package{$packages_unwanted:
ensure => absent,
provider => yum,
}
}
}}

I get the following when running puppet agent --test on a system that already has the two packages installed:

{{
wouterv@bruct06-cal:~$ sudo puppet agent --test
[sudo] password for wouterv:
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/ht.rb
info: Loading facts in /var/lib/puppet/lib/facter/raid.rb
info: Caching catalog for bruct06-cal.office.caliopa.com
info: Applying configuration version 'p3bp-40-g22f6004'
err: /Stage[main]/Gui/Package[gnome-media]/ensure: change from 2.29.91-6.el6 to absent failed: Execution of '/bin/rpm -e gnome-media-2.29.91-6.el6.x86_64' returned 1: error: Failed dependencies:
gnome-media = 2.29.91-6.el6 is needed by (installed) gnome-media-libs-2.29.91-6.el6.x86_64

err: /Stage[main]/Gui/Package[gnome-media-libs]/ensure: change from 2.29.91-6.el6 to absent failed: Execution of '/bin/rpm -e gnome-media-libs-2.29.91-6.el6.x86_64' returned 1: error: Failed dependencies:
libgnome-media-profiles.so.0()(64bit) is needed by (installed) gnome-media-2.29.91-6.el6.x86_64
}}

it may be that this is fixed in more recent versions of puppet (I have no way to check). If so, please feel free to close this issue.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Josh Cooper (JIRA)

unread,
Nov 23, 2015, 1:31:04 PM11/23/15
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-5539
 
Re: circular dependent RPM packages can't be uninstalled

Hi Wouter Verhelst This was first reported in https://projects.puppetlabs.com/issues/1935 over 7 years ago, and was closed as a dup of https://projects.puppetlabs.com/issues/2198, because we'd like puppet to process packages in batches (for a variety of reasons, including handling this case). The redmine ticket 2198 was migrated to JIRA as PUP-1061, so I'm going to close this ticket as a dup of that one.

Wouter Verhelst (JIRA)

unread,
Nov 23, 2015, 3:02:05 PM11/23/15
to puppe...@googlegroups.com

Hi Josh,

While I agree that PUP-1061 would fix the issue, I'm not sure I would call it a duplicate, as this issue is not reproducible on my Debian system. Observe:

wouter@gangtai:~/pup-5539$ apt-cache show 'pup-5539-*'
Package: pup-5539-2
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 9
Maintainer: Wouter Verhelst <wou...@debian.org>
Architecture: all
Multi-Arch: foreign
Version: 1.0
Depends: pup-5539-1
Description: Demo for

PUP-5539 - 2
This package demonstrates circular dependencies in the context of PUP-5539
Description-md5: e16ff26ca636fb3ca372318d2193d8d7

Package: pup-5539-1
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 9
Maintainer: Wouter Verhelst <wou...@debian.org>
Architecture: all
Multi-Arch: foreign
Version: 1.0
Depends: pup-5539-2
Description: Demo for

PUP-5539 - 1
This package demonstrates circular dependencies in the context of PUP-5539
Description-md5: a471646946df2c687ad3933e9611e645

wouter@gangtai:~/pup-5539$ cat remove.pp
$packages = [ "pup-5539-1", "pup-5539-2" ]
package

{ $packages: ensure => absent, }

wouter@gangtai:~/pup-5539$ sudo puppet apply --test remove.pp
Password:
Notice: Compiled catalog for gangtai.grep.be in environment production in 0.26 seconds
Info: Applying configuration version '1448308191'
Notice: /Stage[main]/Main/Package[pup-5539-2]/ensure: removed
Error: Execution of '/usr/bin/apt-get -y -q remove pup-5539-1' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package pup-5539-1
Error: /Stage[main]/Main/Package[pup-5539-1]/ensure: change from 1.0 to absent failed: Execution of '/usr/bin/apt-get -y -q remove pup-5539-1' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package pup-5539-1
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 2.69 seconds
wouter@gangtai:~/pup-5539$ dpkg -l pup-5539-1
dpkg-query: no packages found matching pup-5539-1

While the spurious error about one of the two packages is slightly annoying and might result in false positives, the end result is still that both packages are not installed, exactly what is wanted. A simple way to work around that problem would be to list just one of the packages in the circular dependency; once you've done that, puppet will remove the packages, no problem.

This is because the apt provider uses apt-get remove to remove a package, rather than calling dpkg directly. In contrast, the yum provider uses the rpm command to remove packages, rather than using yum erase, which will (similarly to apt-get remove) consider dependencies before removal.

Since I believe that fixing PUP-1061 will require more work than changing the yum provider so that it calls yum erase rather than rpm -e, and since this is a discrepancy in behaviour between operating systems, I urge you to reconsider.

Having said that, this is your ticketing system and not mine, so I'm not going to insist

Josh Cooper (JIRA)

unread,
Nov 24, 2015, 6:42:03 PM11/24/15
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-5539

Since I believe that fixing PUP-1061 will require more work than changing the yum provider so that it calls yum erase rather than rpm -e, and since this is a discrepancy in behaviour between operating systems

That's a good point, I'd expect puppet to be consistent either way. Let me reopen this and mark it blocked on PUP-1061.

Josh Cooper (JIRA)

unread,
Nov 24, 2015, 6:43:02 PM11/24/15
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
With the following manifest snippet:

{ { code:puppet}
class gui {
$packages_unwanted = [
    "gnome-media",
    "gnome-media-libs",
]

package{$packages_unwanted:
    ensure => absent,
    provider => yum,
}
}
{code } }

I get the following when running {{puppet agent --test}} on a system that already has the two packages installed:

{ { noformat}
wouterv@bruct06-cal:~$ sudo puppet agent --test
[sudo] password for wouterv: 
notice: Ignoring --listen on onetime run
info: Retrieving plugin
info: Loading facts in /var/lib/puppet/lib/facter/ht.rb
info: Loading facts in /var/lib/puppet/lib/facter/raid.rb
info: Caching catalog for bruct06-cal.office.caliopa.com
info: Applying configuration version 'p3bp-40-g22f6004'
err: /Stage[main]/Gui/Package[gnome-media]/ensure: change from 2.29.91-6.el6 to absent failed: Execution of '/bin/rpm -e gnome-media-2.29.91-6.el6.x86_64' returned 1: error: Failed dependencies:

gnome-media = 2.29.91-6.el6 is needed by (installed) gnome-media-libs-2.29.91-6.el6.x86_64

err: /Stage[main]/Gui/Package[gnome-media-libs]/ensure: change from 2.29.91-6.el6 to absent failed: Execution of '/bin/rpm -e gnome-media-libs-2.29.91-6.el6.x86_64' returned 1: error: Failed dependencies:

libgnome-media-profiles.so.0()(64bit) is needed by (installed) gnome-media-2.29.91-6.el6.x86_64
{noformat } }

it may be that this is fixed in more recent versions of puppet (I have no way to check). If so, please feel free to close this issue.

Wouter Verhelst (JIRA)

unread,
Nov 26, 2015, 6:51:05 AM11/26/15
to puppe...@googlegroups.com
Wouter Verhelst commented on Bug PUP-5539
 
Re: circular dependent RPM packages can't be uninstalled

Hi Josh,

This issue is still listed as "duplicate"/"closed", although blocked on
PUP-1061. Is this a misunderstanding on my end of how the system is
supposed to work, or an oversight on yours?


It is easy to love a country that is famous for chocolate and beer

– Barack Obama, speaking in Brussels, Belgium, 2014-03-26

Josh Cooper (Jira)

unread,
Mar 27, 2020, 5:49:03 PM3/27/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Night's Watch
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 27, 2020, 5:49:04 PM3/27/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-5539
 
Re: circular dependent RPM packages can't be uninstalled

Reopened 4 years later :facepalm:

Mihai Buzgau (Jira)

unread,
Mar 31, 2020, 10:48:03 AM3/31/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:51:04 AM11/5/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 3:52:04 AM11/5/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ready for triage

Ciprian Badescu (Jira)

unread,
Oct 21, 2021, 8:11:03 AM10/21/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug PUP-5539
 
Re: circular dependent RPM packages can't be uninstalled

Based on https://puppet.com/docs/puppet/7/types/package.html#package-provider-yum:

Using this provider's uninstallable feature will not remove dependent packages. To
remove dependent packages with this provider use the purgeable feature, but note this
feature is destructive and should be used with the utmost care.

I think the ticket can be closed

 

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Oct 29, 2021, 5:17:01 AM10/29/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 11, 2021, 1:57:02 PM11/11/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages