Set the Default Browser on Ubuntu From the Command Line
Ubuntu Linux has a default browser functionality that will automatically launch the correct browser when clicking on a link in a gnome gui application. It's easy enough to set the default browser using the GUI tools, but sometimes it's easier to set it using the command line client.. for instance, if you are trying to remotely administer a machine.
To change this setting, we'll use the update-alternatives command.
sudo update-alternatives –config x-www-browser
You should see something similar to this. You'll notice that konqueror is the default browser on my computer right now.
$ sudo update-alternatives –config x-www-browser
There are 2 alternatives which provide `x-www-browser'.
Selection Alternative
———————————————–
1 /usr/bin/firefox
*+ 2 /usr/bin/konquerorPress enter to keep the default[*], or type selection number:
If I wanted to select firefox as the default browser, I could just type 1 and hit enter.


im trying to do that but i dont get anything in that list…. my prob is i update from firefox to firefox2, everything is fine besides the fact that some apps when i click on link they dont open the browser anymore ( like gaim ) … im trying to set symlinks but with no luck , so i came to this side, setting default browser but got no luck either
Thanks for sharing. Although, using GUI tools is much easier.
BTW, is there any way of configuring POP/IMAP access for Windows Live Mail in Evolution Mail ??
Thank you! Tell me, how can I change the default email client as well?
Good advice. But: I upgraded to ubuntu 8.04 which includes firefox-3 of course, which sucks, of course. After reverting to firefox-2, fixing the eye-damaging fonts, etc. I found that links from my emails/im etc didn't work. I suspected that something like the default browser was "confused" and tried to change that. This led me here. Typing the command I get:
$ sudo update-alternatives –config x-www-browser
There is only 1 program which provides x-www-browser
(/usr/bin/firefox-2). Nothing to configure.
It seems that only by using the GUI i could add the -2 at the firefox %s command. After I changed it to firefox-2 %s the links worked fine.
Great advice, but note that preceding the worh "config", there are two dashes as:
sudo update-alternatives –config x-www-browser. Hard to see while editing, but it makes all the difference in execution.
thanks for the tip!!! works like a charm
had a problem setting firefox to open html files after following this tip (konqueror still was the default file in opening html files), solved the problem after associating it with ff3 in kubuntu 8.04.1 by right-clicking the file, open with, selected ff3 and checked "Remember application association for this type of file" tick box
just thought I'd add it here…