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

When updating Java this http://johnglotzer.blogspot.com/2013/01/firefox-pluginregdat-whats-dat.html can come in handy as well.

Comments

Anonymous said…
Whew, thanks! This one had me stumped.

Removing the /var/lib/alternatives/javaws file resolved the issue for me, as well.
Anonymous said…
thanks to this post i successfully installed jdk 1.7.0_13 on a rhel 5 server after i was stuck trying to update the references to /usr/bin/jar :)

Thank you!
Anonymous said…
Thank You so much, had the same problem and it helps me.
morganney said…
Thank you. Removing /var/lib/alternatives/javaws worked for me as well.

Popular posts from this blog

Hit failing alternator with a hammer to confirm diagnosis of failing alternator due to bad brushes

Using SSH, SOCKS, tsocks, and proxy settings to create a simultaneous "dual use" work/home computer