update-alternatives: error

In the event that an execution of “apt-get install” terminates following an error of the following type:

(Terminal output for attempted set-up of sun-java6-plugin while /usr/lib/mozilla/plugins/libjavaplugin.so is being managed by mozilla-javaplugin.so~):

Setting up sun-java6-plugin (6.24-1build0.9.10.1)
update-alternatives: error: alternative link /usr/lib/mozilla/plugins/libjavaplugin.so is already managed by mozilla-javaplugin.so~.
dpkg: error processing sun-java6-plugin (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fixing the problem in this particular instance invloved running the following command:

update-alternatives --remove-all mozilla-javaplugin.so~

In order to remove the file that update-alternatives listed as managing the alternative link in question (see line 2 of the block of terminal output above). Subsequent executions of “apt-get install” should not display the same error.

Mark Adamo 2011/04/01 11:24