Description of problem: If one sets an alternative for something to the _last_ available item and then uninstall the package offering that alternative, then that something is not changed to the best available alternative as expected, leaving dangling symlinks and an unusable program(s). Version-Release number of selected component (if applicable): chkconfig-1.3.30.1-2 How reproducible: always Steps to Reproduce: 1. remove all installed java-devel packages 1. yum install java-1.4.2-gcj-compat-devel 2. yum install java-1.6.0-openjdk-devel 3. alternatives --config javac, select the _last_ item (should be /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac) 4. alternatives --display javac | head -n2 (status manual, link points to /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac) 5. yum remove java-1.6.0-openjdk-devel 6. alternatives --display javac | head -n2 (status manual, link points to /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac--wrong!) Actual results: Dangling symlinks. Expected results: Symlinks are restored to point to the best available alternative. Additional info: Source code looks the same in Fedora Rawhide version, so I presume the same bug is present there (I haven't checked it).
Created attachment 362177 [details] a fix
Upstream commit is: http://git.fedorahosted.org/git/?p=chkconfig.git;a=commitdiff;h=2439b08284fb7df194cb7f1e7ee31c40cc78a300
Building as 1.3.30.2-1.el5.
I created a RHTS test for this bug (/CoreOS/chkconfig/Regression/bz525051-alternatives-can-leave-dangling-symlinks-after). The test passed on architectures that provide the package java-1.6.0-openjdk-devel. These are i386 (server, client), x86_64 (server, client). On architectures s390x, ppc64 and ia64 currently only java 1.4 is provided. I consider this chkconfig test as successful.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-1628.html