Bug 120519

Summary: rpm -e commits changes even on error
Product: [Fedora] Fedora Reporter: alvin thompson <al>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: aleksey, barryn, p.van.egdom, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-05 01:37:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 123268    

Description alvin thompson 2004-04-09 19:30:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040312 Epiphany/1.1.12

Description of problem:
if multiple versions of a package are installed, rpm -e behavior is
very bad if ambiguities exist:

[root@t2 root]# rpm -q kernel
[root@t2 root]# rpm -e kernel-2.6.4
error: "kernel-2.6.4" specifies multiple packages
[root@t2 root]# rpm -q kernel

note that one of the packages was removed, anyway. rpm should not
commit changes when an error is presented and never when the results
would be arbitrary, as in this case.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. see above

Additional info:

Comment 1 Jeff Johnson 2004-04-09 22:35:52 UTC
A failure of "rpm -e" when multiple packages installed fails
immediately w/o attempting any operation.

There's no way that the "rpm -e" did anything.

Comment 2 alvin thompson 2004-04-11 19:09:39 UTC
just saying "There's no way that the "rpm -e" did anything" does not
make it true. certainly, what you described is the way it *should*
work, but it's not working that way. that's why this bug is open. look
more closely at the printout; it is verbatim. this bug has been
experimentally verified not only by me, but by others on the #fedora
IRC channel. i've been using redhat linux since '96; please don't just
assume it's operator error.

there is another bug (i forget the number) where if multiple versions
of the same package are installed, 'rpm -e' removes common files. the
bug may be related in some way.

Comment 3 Jeff Johnson 2004-04-12 02:11:58 UTC
You list the display output, not whether the pkg is actually installed.

You also do not identify whether other processes are running.

Do you have a rproducer? Hearsay claims from an irc channel cannot
be reproduced ...

Comment 4 alvin thompson 2004-04-12 16:49:40 UTC
once again, read the output. you'll notice that the first command is
'rpm -q kernel'. the 'rpm -q kernel' command lists the currently
installed kernel packages. if you look at the version numbers, you
will notice that they follow the upgrade path of up2date, so perhaps
the problem lies there. it is reasonable to assume that i've booted
from each kernel at least once (i have).

as you should know, if there were other processes running that
required a lock on the rpm database, the 'rpm -e' process would have
blocked until the lock was available. as i'm sure you also know, this
was a problem with the last few redhat/fedora distros as the lock
would sometimes not get released and it required the user to manually
'kill -9' the rpm process and rebuild the database. this did *not*
happen in this case; there have been no problems with anything
regarding package management on this computer. in fact, this machine
is for the most part a clean installation w/ updates.

if you really think it's relevant, i booted, logged into gnome, opened
a terminal, became root (su -) and ran the command. gaim was also
running. all internet server services are disabled on this box. any
processes running were assosiated with this described state.

sorry, the others that comfirmed the bug are not on the IRC channel
right now. however, it can hardly be called heresay as i--the
submitter of this bug--had this problem and can still reproduce it.

i reproduced the problem with a different kernel version. note the
strange behavior when i run the command a second time. something is
certainly not right here:

[root@t2 up2date]# rpm -q kernel
[root@t2 up2date]# rpm -q kernel-2.6.5
[root@t2 up2date]# rpm -e kernel-2.6.5
error: "kernel-2.6.5" specifies multiple packages
[root@t2 up2date]# rpm -q kernel-2.6.5
[root@t2 up2date]# rpm -e kernel-2.6.5
error: Failed dependencies:
        kernel >= 2.6.4-1.300 is needed by (installed) policy-1.10.2-5
        kernel >= 2.6.4-1.300 is needed by (installed)

after the (first) 'error' line is given, there is a long pause where
the command is still working on something. that is what originally
made me suspicious.

i strongly suggest you find and fix this bug, as it could lead to
major problems if people accidentally remove all versions of a package
on a system, especially the kernel. it may not look good if this bug
were submitted but ignored because someone didn't think is was real...

Comment 5 Aleksey Nogin 2004-04-14 09:09:49 UTC
I tried reproducing it - and indeed, I see it too.

# rpm -q rpm
# rpm -q kernel
# rpm -e kernel-2.6.5
оÑибка: "kernel-2.6.5" Ð·Ð°Ð´Ð°ÐµÑ Ð½ÐµÑколÑко пакеÑов
rpm -q kernel
# rpm -q kernel

Comment 6 Warren Togami 2004-05-06 22:04:44 UTC
[root@ibmlaptop tmp]# rpm -q kernel-source
[root@ibmlaptop tmp]# rpm -e kernel-source
error: "kernel-source" specifies multiple packages

At this point it gets stuck for 2-3 minutes with 100% CPU and disk
clicking like crazy.  Then...

[root@ibmlaptop tmp]# rpm -q kernel-source

Comment 7 Warren Togami 2004-05-18 07:26:30 UTC
rpm did not exhibit this behavior in RH9.  (Just more info.)

Comment 8 Jeff Johnson 2004-10-05 01:37:11 UTC
This has been fixed for a couple months at least:

[root@wellfleet ~]# rpm -q kernel
# rpm -e kernel-2.6.8
error: "kernel-2.6.8" specifies multiple packages
# rpm -q kernel
# rpm -q rpm