Re: /etc/alternatives not working properly [SOLVED]
Kevin Mark wrote:
Me too but having reinstalled java it didn't work :(. Also some of the
links that are missing don't have postinstall scripts I could find.
I'd expect symlinks to
be created with postinstall scripts, so you may want to re-run them.
Those scripts are in /var/lib/dpkg/info/$PKG.postinstall and are usually
Thanks for looking.
this should be the answer. you and I both have java installed and I
looked for the elusive /usr/bin/java with:
grep /usr/bin/java /var/lib/dpkg/info/*.postinst
This turned up: /var/lib/dpkg/info/gij-4.1.postinst
This script creates it.
I tried this and still no /usr/bin/java. I've done some more digging in
this directory and the sun-java5-bin.postinst also creates /usr/bin/java
(among others) so it should have worked by purging/reinstalling this too.
So I tried looking at the prerm scripts to see what they do and they
only remove some of the links created in the postinst scripts and for
some reason only the ones deleted by purging the package are recreated
on reinstalling it.
The solution was to update-alternatives --remove-all java (etc) and then
reinstall the packages that provide java (etc). Now I just need to find
what symlinks are missing so that I can reinstall :).
I think this happened because I restored my /etc directory from a backup
too early in the reinstallation process i.e. before all of the packages
were reinstalled. Therefore when running update-alternatives for say,
java, it already saw an alternative for java in /etc/alternatives and I
think assumes the /usr/bin/java symlink is already there, which it
wasn't, and doesn't create it.
Hope this stops others from falling into the same trap, or helps them if
they have already fallen :)
Thanks for your help Andrew and Kevin