remove & reinstall a package

1,893 views
Skip to first unread message

Arnau Bria

unread,
Feb 4, 2009, 5:14:07 AM2/4/09
to puppet...@googlegroups.com
Hi,

I have a distro problem with a couple of pacakges (I will be fixed in
next release).

Package A.i586 and A.x86_64 do install libraries in same place. So
libraries are 64 bits or 32 depending in the order of A package
installation (both belong to a yum group).

Now seems that metpackage (yum group) installs first 64 bits, then 32,
and I need 32 version, so I remove the 64 version like:

package {"dcache-dcap-1.8.0-15p8.x86_64":
ensure => absent,
}
And works fine.

]# rpm -qa|grep dcache-dcap
dcache-dcap-1.8.0-15p8.i586


but libraries are not 32 bits, cause I remove the rpm, but as lib files
belong to both packages, rpm does not delete those files:

[root@td251 ~]# file /opt/d-cache/dcap/lib/libdcap.so
/opt/d-cache/dcap/lib/libdcap.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
[root@td251 ~]# rpm -qf /opt/d-cache/dcap/lib/libdcap.so
dcache-dcap-1.8.0-15p8.i586

file output should be 32 bits:
[root@td065 ~]# file /opt/d-cache/dcap/lib/libdcap.so
/opt/d-cache/dcap/lib/libdcap.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
[root@td065 ~]# rpm -qf /opt/d-cache/dcap/lib/libdcap.so
dcache-dcap-1.8.0-15p8.i586


So, I'm trying to do a remove, remove, install, but puppet complains
about removing/installing same package:

package {"dcache-dcap-1.8.0-15p8.x86_64":
ensure => absent,
before => Package["dcache-dcap-1.8.0-15p8.i586"],
}
>>>> package {"dcache-dcap-1.8.0-15p8.i586":
ensure => absent,
before => Package["dcache-dcap-1.8.0-15p8.i586"],
}
>>> package {"dcache-dcap-1.8.0-15p8.i586":
ensure => present,
before => Package["dcache-client-1.8.0-0.noarch"],
}
package {"dcache-client-1.8.0-0.noarch":
ensure => present,
}

[...]

err: Could not retrieve catalog: Puppet::Parser::AST::Resource failed with error ArgumentError: Duplicate definition: Package[dcache-dcap-1.8.0-15p8.i586] is already defined in file /etc/puppet/manifests/modules/local_conf/manifests/init.pp at line 89; cannot redefine at /etc/puppet/manifests/modules/local_conf/manifests/init.pp:93 on node td251.pic.es


And, removing a package and its dependecies is possible?
err: /:main/Node[td251.pic.es]/worker-node/local_conf/Package[dcache-dcap-1.8.0-15p8.i586]/ensure: change from 1.8.0-15p8 to absent failed: Execution of '/bin/rpm -e dcache-dcap-1.8.0-15p8.i586' returned 1: error: Failed dependencies:
dcache-dcap is needed by (installed) dcache-client-1.8.0-0.noarch

How may I remove/install same package?

TIA,
Arnau

Arnau Bria

unread,
Feb 4, 2009, 5:37:18 AM2/4/09
to puppet...@googlegroups.com
I've created alittle script with yum install / remove and done
something liek:

exec {"lhcb_patch":
command => "/usr/local/sbin/lhcb.sh",
timeout => "-1",
unless => "file /opt/d-cache/dcap/lib/libdcap.so|grep 32-bit >/dev/null",
}

but I'd like to know if this is possible with package type.

Cheers,
Arnau

Peter Meier

unread,
Feb 4, 2009, 8:00:30 AM2/4/09
to puppet...@googlegroups.com, Arnau Bria
Hi

> but I'd like to know if this is possible with package type.

no, I don't think so. The "problem" is that each resource have to
uniquely identified and as the package is called twice the same, this
won't work.
However I would say as this is rather a one-shot-special-task, which
isn't really a configuration definition, your way with the script is
the right approach. Maybe a couple of execs would fit as well.

cheers pete.

Reply all
Reply to author
Forward
0 new messages