Set the Default Browser on Ubuntu From the Command Line

By Lowell Heddings on December 5th, 2006

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/konqueror

Press 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.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/5/06
More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!