How to set default browser on Ubuntu in commandline?

Here is a quick tip to help you reset your default browser on Ubuntu in command-line, and it works on Debian as well.

To set the default browser, you can simply open up a terminal and run the command as below,

root@deb:~# update-alternatives --config x-www-browser

Here is a sample output,

There are 2 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

Selection Path Priority Status
* 0 /usr/bin/iceweasel 70 auto mode
1 /usr/bin/chromium 40 manual mode
2 /usr/bin/iceweasel 70 manual mode

Press enter to keep the current choice[*], or type selection number: 1 [Enter]
update-alternatives: using /usr/bin/chromium to provide /usr/bin/x-www-browser (x-www-browser) in manual mode

Note that, this command will change the global settings, it’s not per user based.

Leave a comment

Your email address will not be published. Required fields are marked *