On Apr 11, 2007, at 10:27 AM, Wes Rogers wrote:
I'm trying to manage some RPM-GPG-KEYS with an RPM.
But, what I want to do is remove all keys before installing the new
ones. Unfortunately, it seems I can't actually do remove actions
inside the RPM, because it complains :
warning: waiting for transaction lock
error: can't create transaction lock
I'm trying to do this first before rpm --importing the public keys :
/bin/rpm --erase --allmatches -- gpg-pubkey
I also tried by calling an external script inside the RPM to do this,
but I still get the same result. I'm sure there is a better way, any
thoughts? I'd like to try to get this done inside the RPM, so when
the RPM is installed or upgraded, any new/old keys are properly
handled.
Just remove the transaction lock before running "rpm --import" in %post.
What will be a little tricky is finding the lock, as the path has
changed.
Originally the path was
/var/lock/rpm/transaction
That turned out to be too hard for users to understand how to remove.
So the path was changed to
/var/lib/rpm/__db.000
because many users are used to doing "rm -f /var/lib/rpm/__db*"
when necessary.
Alas, *THAT* path was global, not per-chroot, so the other version of
rpm
has chosen a per-chroot path. Dunno exactly what path is being used ...
Meanwhile, since there really is little need for Yet Another Locking
Scheme
with rpm, rpm-4.46 and later default configuration does not use the
fcntl
transaction lock at all. The mechanism is still there for distros to
use if necessary.
Anyways, the short answer is do this in %post
rm -f /var/lib/rpm/__db.000 # <== change the path as appropriate
rpm --import whatever.pubkey
FWIW, rpm-4.4.2 can support downloads of pubkeys from key servers which
is perhaps a better solution for installing pubkeys than trying to
run rpm --import
in %post. YMMV.
hth
73 de Jeff
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list