Bug 1049015 - in F20 each update breaks alternatives
Summary: in F20 each update breaks alternatives
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: jiri vanek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-06 19:21 UTC by Harald Reindl
Modified: 2014-01-15 14:05 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-15 14:05:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald Reindl 2014-01-06 19:21:10 UTC
i faced the need of "alternatives --config java" the first time after dist-upgrade to F20 and thought this was caused by recent changes, but after manually update to the koji.build from today the same again

why is /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java missing?
____________________________________________

Aktualisiert:
  java-1.7.0-openjdk.x86_64 1:1.7.0.60-2.4.3.4.fc20          java-1.7.0-openjdk-headless.x86_64 1:1.7.0.60-2.4.3.4.fc20         

Komplett!
[root@srv-rhsoft:/downloads]$ java -version
-bash: java: Kommando nicht gefunden.
[root@srv-rhsoft:/downloads]$ alternatives --config java

Es gibt 2 Programme, welche »java« zur Verfügung stellen.

  Auswahl    Befehl
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.4.fc20.x86_64/jre/bin/java

Eingabe um die vorgegebene Auswahl[+] zu behalten, oder geben Sie die Nummer an:2
[root@srv-rhsoft:/downloads]$ java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (fedora-2.4.3.4.fc20-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

Comment 1 jiri vanek 2014-01-07 08:04:10 UTC
hi!

I'm a bit confused by this report, as the alternatives handling had (nearly) not  changed.

The differences between f20 and f19 package are two:
 - jre was split to headless and "rest".
 - the alternatives do not forcibly change after update  if you are already on manual mode


From your report it is not clear which caused the issue. From first, it seems that headless (the more important with java command and alternatives logic) part of jre was not installed. It would be critical if it did not. 

The second part looks even more strange - the "/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java" alternatives record should not exist at all!

I hope, that your issue was caused by alternatives in manual mode for longer time (remaining item in alternatives) and so not changed alternative after dist update.

Anyway will need more investigations on both yours an (especially)my side.

Comment 2 Harald Reindl 2014-01-07 08:26:36 UTC
> it seems that headless  part of jre was not installed

as you can also see above both are there and updated
java-1.7.0-openjdk.x86_64 1:1.7.0.60-2.4.3.4.fc20          
java-1.7.0-openjdk-headless.x86_64 1:1.7.0.60-2.4.3.4.fc20

> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

nonsense

/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java *should exist* and not only the fullversioned /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.4.fc20.x86_64/jre/bin/java which changes with every update

> caused by alternatives in manual mode for longer time

pretty sure, the machine was originally instaleld with F14

i do not need the whole alternatives crap but it's impossible to work with manual symlinks too if install folders are full versioned which is complete nonsense in case of normal packages which can be installed only in one version at any point of time

Comment 3 jiri vanek 2014-01-07 11:41:01 UTC
(In reply to Harald Reindl from comment #2)
> > it seems that headless  part of jre was not installed
> 
> as you can also see above both are there and updated
> java-1.7.0-openjdk.x86_64 1:1.7.0.60-2.4.3.4.fc20          
> java-1.7.0-openjdk-headless.x86_64 1:1.7.0.60-2.4.3.4.fc20
> 
> > /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
> 
> nonsense

nope. Sense. All alternatives are now linked directly via fully versioned path.

This is necessary to have multiple eopenjdk7 installed.

The link you wont is outdated. You can remove it.
> 
> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java *should exist* and not only
> the fullversioned
> /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.4.fc20.x86_64/jre/bin/java
> which changes with every update
> 
> > caused by alternatives in manual mode for longer time
> 
> pretty sure, the machine was originally instaleld with F14

Yes, I see the case now. Since you have alternatives on manual, and you have the legacy symlink, then f20 's openjdk do not update the alternatives.

What happened:
 You have the legacy synlink
 F19's jdks always removed previous one, and set last installed jdk's java/javac as alternatives target 
 you updated on f20 - the previous installation (and its links) disapeared, the legacy one remained, and was set as main. 
 you have alternatives on manual, so newly added record was not set as target for java/javac

If you remove the legacy symlinkt he alternatives should work for you as expected.

Sorry for inconvenience. I was removing this symlink several times, but looks like this update somehow avoided you.
> 
> i do not need the whole alternatives crap but it's impossible to work with
> manual symlinks too if install folders are full versioned which is complete
> nonsense in case of normal packages which can be installed only in one
> version at any point of time

You are trying to use  the installation out of the current box:

You should use only the links:
 - /usr/bin/{java,javac...}
 - /usr/lib/jvm/{java,java-1.7.0,java-1.7.0-openjdk,java-1.7.0-openjdk.arch,java-openjdk,similarForJre} 
 - jre and sdk as set by alternatives

If yo confirm "What happened"+workAround then I will close this as "not a bug".
It will probably happen anyway once I will double check.

Once sorry for inconvenience. I was really trying to cleanup the alternatives  during f14-f20 lifetimes, but some cases could escape.

Comment 4 Harald Reindl 2014-01-07 11:47:53 UTC
> This is necessary to have multiple eopenjdk7 installed

oh my god - hopefully we go not in the direction Sun was for years that old and vulnerable JRE's where not removed by updates.......
_______________________

remove *which* "legacy symlink"

i have no single idea why alternatives links to /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java after the update because it was using the named one already because the breakage happened due the dist-upgrade the first time

i already fixed that once by alternatives --config java

so *what* file/link to remove that in the future it does not happen again

Comment 5 jiri vanek 2014-01-07 12:55:07 UTC
(In reply to Harald Reindl from comment #4)
> > This is necessary to have multiple eopenjdk7 installed
> 
> oh my god - hopefully we go not in the direction Sun was for years that old
> and vulnerable JRE's where not removed by updates.......

no!

Updates are working correctly. Once you update, old jre is removed.

This feature is based on rpm -i. You can add custom jdk based on current packages.

It may sound strangely to you but it was requested by many users.
> _______________________
> 
> remove *which* "legacy symlink"
> 
> i have no single idea why alternatives links to
> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java after the update because it
> was using the named one already because the breakage happened due the
> dist-upgrade the first time
> 
> i already fixed that once by alternatives --config java
> 
> so *what* file/link to remove that in the future it does not happen again

remove this one: *+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

Comment 6 Harald Reindl 2014-01-07 13:04:13 UTC
> remove this one: *+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

what the hell - this one does not exist at all and that is why it is clearly a bug that it is offered and even set as default after each and every update

[root@rh:~]$ stat /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
stat: cannot stat '/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java': No such file or directory
[root@rh:~]$ alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
 + 2           /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.3.4.fc20.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number:

Comment 7 jiri vanek 2014-01-07 13:40:59 UTC
Please, remove all alternatives records which do not point to fully versioned directories, or to another alternatives  - like   /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

Comment 8 Harald Reindl 2014-01-07 13:52:35 UTC
if i would know from where it takes /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java i would have removed it instead write a bugreport

Comment 9 jiri vanek 2014-01-08 08:08:36 UTC
I'm not sure if we understand each other.

existence of link of /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/ is meaningless. 
Whether it exists or not, you can unlink it or let it be.

Important is record in alternatives. So please remove it:

sudo alternatives   --remove java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

Also please check if you do not have similar relics under keys of:
jre_1.7.0
javadocdir
jre_openjdk
jre_1.7.0_openjdk
java
java_sdk_1.7.0_openjdk
java_sdk_openjdk
java_sdk_1.7.0
javac

Comment 10 Harald Reindl 2014-01-08 12:25:18 UTC
> I'm not sure if we understand each other

i am not working daily with "alterantives", frankly i would not need 
it at all and that's why even as i am software developer did not
know how to get rid of this problem until your post with "alternatives --remove java /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java", hence that is why this should be done by the update itself

Comment 11 jiri vanek 2014-01-08 15:43:33 UTC
Sure!

 After you removed the legacy entries, the update should handle it on its own.
 Sorry that the "clean up code" of old alterantives have not affected your system.


Please, when you do another update  sucess, close the bug (unless I will do it first)

Comment 12 Harald Reindl 2014-01-08 15:45:12 UTC
i will give feedback after the next openjdk-update


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