How to fix "Failed to execute the default web browser" error on Linux

Endrit Qerreti

Endrit Qerreti

Web browser is a button on XFCE desktop, that will open the default web browser when you click it. This button will only launch the default web browser of your system, no matter the web browser.

However, when this button is not configured, or when you don't have a web browser installed on your system, if you try to click "Web browser" button, you will get the error " Failed to execute the default web browser"

This error happens because the default web browser couldn't be found on your system.

There could be multiple reasons why this error happens. However, one of the reasons why this error happens is because the system doesn't know what the default web browser is.

In this tutorial, you will learn how to fix this error, and how to make it so when you click the "Web browser" button, to launch your favorite web browser.

We are using Arch Linux with XFCE as desktop environment for this tutorial.

Step 1 - Install Web browser

You can use any web browser and make it the default web browser on your system.

However, in this tutorial, we are going to install firefox, and make it the default web browser on our system, so when you click to "Web browser" it should open firefox.

Now to install firefox on Arch Linux, we can use pacman, the default package manager

sudo pacman -S firefox

Once firefox has been installed on our system, we can move on to the next step to configure the web browser button.

Configuring web browser button is easy, and you can do it by running a simple command on your terminal.

Step 2 - Configure Web browser button

To configure Web browser button, first we must set firefox as the default web browser on our system. To do this, we can use the command below

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

Next, we need to verify that the default web browser is now firefox. Simply run the command below

xdg-settings get default-web-browser

As you can see, firefox is now the default web browser on our system, all we have to do now is to test the Web browser button.

Step 3 - Use Web Browser button

Web Browser button is located on Applications Menu, and also on the panel. Now the Web browser button will launch firefox when clicked.

Conclusion

In this tutorial, you leaned that when Web browser button it's not configured, or when there's no browser installed on your system, you get the error "Failed to execute the default web browser". This is an error that happens on any Linux distro that uses XFCE as desktop environment.