PREIN failing when using yum api to update a package

Karthik Ram listaction at
Tue Nov 12 16:30:03 UTC 2013

I am trying to use the yum api to patch a package.

It works in most cases but in some cases it does fails and gives strange

When I look at the yum cli source code, it appears that it uses the
rpmtrans directly and not the yum api to perform updates.

here's a test code:
import yum;
updates = ['initscripts']
yumb = yum.YumBase()
pl = yumb.doPackageLists('updates')
exactmatch, matched, unmatched = yum.packages.parsePackages(pl.updates,
yb = yum.YumBase()
yb.conf.assumeyes = True
for po in exactmatch:
yb.processTransaction() #omitting callbacks for illustration

and here's the error:
# python
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * updates:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * updates:
Running rpm_check_debug
Error in PREIN scriptlet in rpm package
/var/tmp/rpm-tmp.JGu9SX: line 1: /usr/sbin/groupadd: Permission denied
error: %pre(initscripts-9.03.38-1.el6.centos.2.x86_64) scriptlet failed,
exit status 126
error:   install: %pre scriptlet failed (2), skipping
initscripts-9.03.38-1.el6.centos.x86_64 was supposed to be removed but is
Verify: 1/2: initscripts.x86_64 0:9.03.38-1.el6.centos - ud
Verify: 2/2: initscripts.x86_64 0:9.03.38-1.el6.centos.2 - u

The same thing works if I call the yum cli - and I believe ud flag  - where
it is trying to remove it is not getting removed (and yum cli appears to
use the rpmtransaction directly and not this api).

My understanding is that buildtransaction does depsolve and process will do
whatever has to be done to each package in the transaction set (if
something has to be deprecated).

os info:
 uname -a
Linux CentOS6464b 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m
This does not happen on all centos 6.4s but in this case - the fact that
yum cli works and the api does not is the main issue.
Any ideas on how to resolve this?

thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Yum-devel mailing list