Why does Chrome not stay as the default browser in Xubuntu 13.04?

7,527

Solution 1

The underlying problem is reported here:

https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/902661

Chrome and Chromium do not play nicely in the xfce4 environment, and will corrupt the xfce4 settings for web browser in Preferred Applications. Simply tell Chrom{e,ium} not to ask you any more, then set the default settings through Settings Manager > Preferred Applications.

Solution 2

A way to set the default browser system-wide, inherited from Debian, is to set a default browser as the system "alternative". "alternatives" is a convention introduced in Debian GNU/Linux to handle concurrent applications for the same task, i.e. Firefox and Links for web brosing.

Set the alternative on the terminal by running:

sudo update-alternatives --set x-www-browser /usr/bin/chromium

and I believe recently they also came up with the gnome-browser, so run:

sudo update-alternatives --set gnome-www-browser /usr/bin/chromium

This modifies the symlink infrastructure, which you find in /etc/alternatives. Your desktop environment should make use of these settings (that doesn't mean it does).

Your experience (with the setting beeing temporary) suggests, that your desktop environment uses an environment variable, to make the setting known. Run "env |sort" in a terminal once before making the setting in your settings-manager and once after, and compare the outputs.

I suspect (without knowing) that the settings-manager introduces some variable, maybe something like XDG_BROWSER=/usr/bin/chromium. You should be able to see the details. Create the file .xinitrc in your home directory, make it executable and modify its content to read:

export XDG_BROWSER=/usr/bin/chromium

(or whatever the environment variable was)

But try the update-alternatives aproach first, maybe this is enough.

Solution 3

I think I have an answer to an old question that still persists in xubuntu 14.0.4. Put this in the preferred applications (found in "all settings".

/usr/bin/google-chrome-stable %U

The way I found this was right clicking the icon for applications and chose edit applications. I'm guessing most of you know it from here.

Share:
7,527

Related videos on Youtube

Peter Flynn
Author by

Peter Flynn

Updated on September 18, 2022

Comments

  • Peter Flynn
    Peter Flynn over 1 year

    If I go to Settings Manager > Preferred Applications and make Chrome (or chromium-browser; there are entries for both!) the default browser, then logout or reboot and come back, the default browser is null again. The same happens if I click a URL in another application (eg Thunderbird); it says I have no default browser set. If I set it to Chrome, it works for the session, but reverts to unset afterwards. Is there some other place it must be set?

  • h3.
    h3. about 10 years
    update-alternatives isn't “the correct way”: it sets the system-wide default, and that default isn't actually used in Unity and Gnome at least, and probably not in Xfce either given that “Preferred Applications” apparently takes precedence.
  • GhostCat
    GhostCat almost 10 years
    Just tried this on a frest xubuntu 14.04 - doesn't work for me. In addition: update-alternatives points to chrome for both x-www-browser and gnome-www-browser
  • lorenzo-s
    lorenzo-s almost 9 years
    After installing Chrome, I have the issue that some of apps (XFCE stuffs mostrly) will use Firefox as default (and that's what I want), some other uses Chromium instead. Preferred Applications was set to Firefox, so using update-alternatives was the only way for me to really set Firefox as default for every single application. Thank you!!!
  • mjs
    mjs over 7 years
    How do you tell chrome to stop asking??
  • EarthToAccess
    EarthToAccess about 5 years
    either when the popup arises asking, or in chrome://settings