The error is
update-alternatives: error: error creating symbolic link '/usr/lib/xulrunner-addons/plugins/libjavaplugin.so.dpkg-tmp': No such file or directory
This happens because /usr/lib/xulrunner-addons/plugins doesn't exist. I think it's not needed in newer mozilla firefox. However , this can be resolved by creating the folder
sudo mkdir -p /usr/lib/xulrunner-addons/plugins
do the job.