• subscribe
  • twitter

How to Set the Default Browser on Ubuntu From the Command-Line

My Ubuntu 9.04 “Jaunty” will soon explode with the growing number of web browsers I dump into it each day and punctually each newly installed web browser has this message when you run it the very first time run it; “Make me your default browser”. I just ignore the message cause I’m never really sure which browser should be the default --at times i change the default twice, thrice a day. The easy way to do it on my Ubuntu is from the command-line, its faster and easier than using the GUI tool.

To change the default or re-confirm the default browser drop the line of code in the terminal (command-line) , we’ll use the update-alternatives command.
$ sudo update-alternatives --config x-www-browser
You’ll see something very similar to what I have below

There are 5 alternatives which provide `x-www-browser'.

Selection Alternative
1 /usr/bin/firefox-3.0
2 /usr/bin/firefox-3.5
3 /usr/bin/google-chrome
*+ 4 /usr/bin/opera
5 /usr/bin/chromium-browser

Press enter to keep the default[*], or type selection number:
Right now I have Opera 10 browser as my default web browser

If I want, say google-chrome as default browser then just type-in 3 and hit enter. You’re done. Till the next time you want to change your default browser.