Ubuntu – Can’t change default browser in Lubuntu 19.04

browserfirefoxgoogle-chromelubuntu

I recently installed Lubuntu 19.04 (LXQt) and I want to change the default browser from Firefox to Google Chrome. However, even though I set Chrome as the default browser in the settings, Firefox still remains the default whenever I try to open html files from my computer (or click on any links).

I'm not sure why the OS is not listening to my instructions. I've set chrome as the default browser in both the "Session Settings" menu, and the "update-alternatives." I've even changed it manually in /usr/share/applications/defaults.list, and it still won't change. No matter what I do, Firefox remains the default browser.

Any idea what's going on ?

PS: I know I could probably solve the problem by removing Firefox, but I don't want to do that. I want to keep both browsers installed, just have Chrome be the default.

Best Answer

Ideally you'd just follow the manual, ie.

https://manual.lubuntu.me/3/3.2/3.2.17/alternative_configurator.html

however it doesn't work for browser due to a known issue (Task 53 for the Lubuntu Team).

On the bug https://bugs.launchpad.net/ubuntu/+source/lxqt-session/+bug/1824654 there is a workaround, which is :-

WORKAROUND

  1. Remove $BROWSER from the /etc/xdg/xdg-Lubuntu/lxqt/session.conf
  2. Remove $BROWSER from the $HOME/.config/lxqt/session.conf
  3. Get rid of the environment variable with unset BROWSER
  4. Follow these rules for switching browsers:
    • Do NOT use $BROWSER, which can be set as a "Default Application" or an "Environment Variable" in lxqt-config-session ("Session Settings")
    • To switch between chromium, firefox, or opera as default browsers, you can use the in-application mechanism
    • For browsers without an in-application mechanism:
      1. Find the desktop file in /usr/share/applications associated with the browser, e.g. chromium-browser.desktop
      2. Run xdg-settings set default-web-browser browser.desktop

Please note I've just copy/pasted the work around from the 1824654 bug report. The T53 task can be found at https://phab.lubuntu.me/T53 though it may require login permissions

All information here was provided by @wxl