alternatives --install gets stuck: failed to read link: No such file or directory
Alternatives utility gets stuck doing install. Fedora 17 x86_64.
Removing the /var/lib/alternatives/javaws file resolved the issue (for me).
# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws 20000
failed to read link /usr/bin/javaws: No such file or directory
# ls /usr/bin/javaws
ls: cannot access /usr/bin/javaws: No such file or directory
# ls -al /var/lib/alternatives/javaws
-rw-r--r--. 1 root root 105 Sep 22 11:39 /var/lib/alternatives/javaws
# rm /var/lib/alternatives/javaws
rm /var/lib/alternatives/javaws
rm: remove regular file `/var/lib/alternatives/javaws'? y
# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws 20000
# which javaws
/bin/javaws
# ls /usr/bin/javaws
/usr/bin/javaws
# ls -al /var/lib/alternatives/javaws
-rw-r--r--. 1 root root 65 Sep 22 11:50 /var/lib/alternatives/javaws
# cat /var/lib/alternatives/javaws
auto
/usr/bin/javaws
/usr/java/jdk1.7.0_07/jre/bin/javaws
20000
Comments
Removing the /var/lib/alternatives/javaws file resolved the issue for me, as well.
Thank you!