Hi Jon,

this is more like a security mechanism to prevent YUM from removing 
dependencies in a very unexpected and unattended way.
>From my experience I have already tried to achieve such thing: I wanted to 
get rid of sendmail but this also deleted critical packages such as cron 
(!). Using RPM prevents this to happen by forcing you to explicitly adding 
any package depending on your undesired package to the "absent" list.
 

On Tuesday, April 22, 2014 9:16:22 PM UTC+2, Jon Forrest wrote:
>
> (I found a discussion from 6/22/09 on this topic, but that was a long time 
> ago.)
>
> Using Puppet 3.5.1 on CentOS 6.5 I recently created the following:
>
>   package {
>     [ "PackageKit"]:
>       ensure => absent,
>   }
>
> However, when I ran Puppet, I got
>
> Error: Execution of '/bin/rpm -e PackageKit-0.5.8-21.el6.x86_64' returned 
> 1: error: Failed dependencies:
>         PackageKit = 0.5.8-21.el6 is needed by (installed) 
> PackageKit-yum-0.5.8-21.el6.x86_64
>         PackageKit = 0.5.8-21.el6 is needed by (installed) 
> PackageKit-glib-0.5.8-21.el6.x86_64
>         PackageKit is needed by (installed) 
> PackageKit-yum-plugin-0.5.8-21.el6.x86_64
>
> Notice that the provider is running '/bin/rpm' which explains the errors. 
> So, I explicitly added
> a provider, so that the resource definition is this:
>
>  package {
>     [ "PackageKit"]:
>       provider => 'yum',
>       ensure => absent,
>   }
>
> There was no change!!
>
> In the discussion from 2009, somebody suggested using "purge" instead of 
> "absent",
> so I did. But although Puppet now uses yum, it does so in a very strange 
> way:
>
> Error: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install 
> PackageKit-purge' returned 1: Error: Nothing to do
> Wrapped exception:
>
> This looks like a bug to me.
>
> I ended up using
>
>   exec { "/usr/bin/yum -y remove PackageKit":
>         onlyif => "/bin/rpm -qa |/bin/fgrep PackageKit",
>     }
>
> but this is a step in the wrong direction.
>
> Comments?
>
> Jon Forreset
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/711bfb94-6156-4057-9568-a1decfca90a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to