PCsuggest

  • Quick tip
  • SECURITY
  • NETWORKING
  • OpenWrt
  • HARDWARE

How to set default browser on Linux

Updated - July 11, 2020 by Arnab Satapathi

For different purpose, we often have multiple browsers installed on our system.

Like I use Chromium browser as daily driver, and Firefox for banking and financial transactions. Also most of us don't want to open every link on a single browser.

That's when you need to set a system default web browser for daily usage, and install few other for other tasks.

In this article I'll discuss about how you can set default browser on any Linux distributions.

This could be done in many different ways with varying results. I'll discuss about some of the most used techniques. Let's get started.

Contents

  • Set default browser with xdg-settings
  • Change default browser with update-alternatives
  • Conclusion

Set default browser with xdg-settings

To change default browser on Linux, use the xdg-settings command.

As an example, to set Chromium as system default browser, use

xdg-settings set default-web-browser chromium-browser.desktop

You can get list of available applications under the /usr/share/application directory.

Another example, to set Falkon as default browser, use the command below.

xdg-settings set default-web-browser org.kde.falkon.desktop

Note: If the $BROWSER environment variable is already set, the above commands with XDG wont work. You need to unset it first. Use unset BROWSER to unset it.

amazon prime logo
Try AmazonPrime for free
Enjoy free shipping and One-Day delivery, cancel any time.

You can get the currently set default browser by running this command. > xdg-settings get default-web-browser

Change default browser with update-alternatives

Another command is update-alternatives.

To change default browser, run the update-alternatives command like below.

sudo update-alternatives --config x-www-browser

Obviously the command will ask for the user password, after that it will list all available browsers on your system with a numbered list.

update-alternatives change default browser linux

From that list. choose your preferred browser and set it via the particular number.

As example I choose 0 to set Falkon as default, which was the already default by the way.

Note that this command uses sudo, so the change is system wide.

Conclusion

Application defaults can be set or changed very easily via some graphical programs too. These tools are preinstalled if you're using a full-blown Gnome or KDE desktop.

SO, that's all about how you can change default browser for Linux using the command line tools. Leave comments if you've any suggestions or question.

Filed Under: linux basics Tagged With: browser, Linux apps, web browser, XDG

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © PCsuggest.com · All rights reserved.

  • Home
  • About
  • Contact
  • Privacy Policy
  • Sitemap