Ubuntu sometimes launches the wrong web browser

I just upgraded to Ubuntu Oneiric 11.10, and aside from being forced to abandon Gnome 2 for Unity or Gnome 3, I found an annoying bug that took me a while to fix. Although I have set up Firefox as my default web browser, I was finding that sometimes Epiphany would get launched instead. Specifically this problem turned up in my app PenguinTV.

The reason for this is that although there is a per-user “preferred application” setting, there is also a system-wide setting that can only be changed on the command line. Run this command in a terminal:

sudo update-alternatives --config gnome-www-browser

This will give you a list of browsers to choose from, one of which will be the one you actually want.