Bug 236734

Summary: upgrade problems with multiple versions of Java RPM's
Product: [Fedora] Fedora Reporter: JJ Keijser <jan.just.keijser>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-04 13:18:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description JJ Keijser 2007-04-17 12:49:47 UTC
Description of problem:

I seem to have an issue with RPM in combination with Sun's Java JDK RPMs.
On my FC5 box (or RHEL3 or RHEL4 box, for that matter) I want to install both
j2sdk 1.4.2 and jdk 1.5.0 from Sun: 1.4.2 for backwards compatibility testing,
1.5.0 for new development; for this I use the RPM's provided by sun, which
install fine. The j2sdk 1.4.2 is installed into /usr/java/j2sdk1.4.2_11 and the
jdk 1.5.0 is installed into /usr/java/jdk1.5.0_08. So far so good.

The problem arises when I install an *upgrade* for the j2sdk1.4.2 RPM:
  rpm -Uvh --test -vv j2sdk-1_4_2_13-linux-i586.rpm

If there's another RPM installed on the system which depends on jdk1.5, this
upgrade will fail. I have also installed java-1.5.0-sun-compat-1.5.0.08-1jpp
from http://www.jpackage.org. Now 
# rpm -U --test j2sdk-1_4_2_13-linux-i586.rpm
gives:

error: Failed dependencies:
        jdk = 2000:1.5.0_08-fcs is needed by (installed)
java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch

This all seems related to the 'provides' from both rpm's:

# rpm -q --provides j2sdk
j2sdk = 2000:1.4.2_09-fcs
 
# rpm -q --provides jdk
jre = 1.5.0_08
j2sdk = 1.5.0_08
j2re = 1.5.0_08
jaxp_parser_impl
xml-commons-apis
jdk = 2000:1.5.0_08-fcs

The fact that the jdk RPM also provides j2sdk but *without* the epoch 2000:
seems to make RPM want to throw away jdk1.5 !!! Why? There are no conflicts or
obsoletes in both packages:

# rpm -q --conflicts j2sdk
(none)
# rpm -q --obsoletes j2sdk
(none)
# rpm -q --conflicts jdk
(none)
# rpm -q --obsoletes jdk
(none)

This RPM behaviour causes the upgrade to fail, as other packages depend on the
jdk1.5 explicitly . 

Version-Release number of selected component (if applicable):
this happens in
- rpm-4.4.2-15.2 (fc5)
- rpm-4.2.3 (el3)
- rpm-4.3.3 (el4)

How reproducible:
100%

Steps to Reproduce:
1. install j2sdk 1.4.2_09 rpm from Sun
2. install j2sdk 1.5.0_08 (or higher) rpm from Sun
3. upgrade j2sdk 1.4.2 to 1.4.2_13 from Sun

Actual results:
it will remove jdk 1.5.0_08 or , in case another rpm depends on jdk-1.5, the
upgrade will fail

Expected results:
- upgrade j2sdk1.4.2_09 to j2sdk1.4.2_13
- leave jdk1.5.0_08 alone

Comment 1 Jeff Johnson 2007-04-17 17:37:22 UTC
An upgrade will erase any package with a provides of the same name and a lowe version.

So the rpm behavior is as expected even if not desired for your java packages.

Comment 2 Jeff Johnson 2007-04-29 12:58:00 UTC
Adding --noupgrade when installing will disable the erasing of older packages, and
erasing whatever packages manually afterwards might work.

That's about all that can reasonably be accomplished to handle this specific multi-jdk problem.

UPSTREAM

Comment 3 Panu Matilainen 2007-07-04 13:18:57 UTC
Provides as implicit obsoletes behavior has been reverted in rpm 4.4.2.1 for
reasons like this.
FC5 is EOL but fixed in rawhide...