Bug 236734 - upgrade problems with multiple versions of Java RPM's
upgrade problems with multiple versions of Java RPM's
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Depends On:
  Show dependency treegraph
Reported: 2007-04-17 08:49 EDT by JJ Keijser
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-04 09:18:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description JJ Keijser 2007-04-17 08:49:47 EDT
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-
from http://www.jpackage.org. Now 
# rpm -U --test j2sdk-1_4_2_13-linux-i586.rpm

error: Failed dependencies:
        jdk = 2000:1.5.0_08-fcs is needed by (installed)

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
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
# rpm -q --obsoletes j2sdk
# rpm -q --conflicts jdk
# rpm -q --obsoletes jdk

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:

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 13:37:22 EDT
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 08:58:00 EDT
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.

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

Note You need to log in before you can comment on or make changes to this bug.