Set Firefox as the default browser on Linux

Many different browsers are available on Linux, including Chrome/Chromium, Firefox and Epiphany. All of them can be installed and used at the same time.

If you click on a link in a PDF, however, your document reader might not open the website with your favourite browser.

Setting the default browser is easy by using the xdg-mime command. To make this utility available on your system, install the package xdg-utils. Now open a terminal window and type in the following command:

xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default firefox.desktop x-scheme-handler/https

If Opera was your default browser before, xdg-mime would have returned opera-116-browser.desktop. After applying the above command you should see firefox.desktop.

$ xdg-mime query default x-scheme-handler/http
firefox.desktop
$ xdg-mime query default x-scheme-handler/https
firefox.desktop

The change can easily tested with the command xdg-open.

xdg-open http://example.com

Coming soon

In the upcoming weeks the topic will be all about docker. The first post of this series will cover some preparation on an OpenVZ-based VPS ‒ more precisely this will be about creating virtual network bridges ‒ followed by a couple of docker-centric howtos.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>