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 Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »