google-chrome-stable keeps asking if it should be set to default

For the working fix, see the end of this answer.

INITIAL ANSWER Oct 28th 2015 (outdated fix)

To avoid being asked if you want to use Chrome as the default browser, use the following workaround (proposed here and suggested in the comment section of this question by Yurii Kolesnykov):

Open the file ~/.config/google-chrome/Default/Preferences with a text editor.

Find the line

"check_default_browser": true,

and replace it with

"check_default_browser": false,

In my case, the file was >200k characters, for which reason gedit crashed a few times. If it is the same in your case, you probably want to use a terminal-based editor like vi.

Please note that this is a workaround, the problem itself has to be fixed by the Chrome developers.

UPDATE Nov 24th 2015

As Danilo Piazzalunga mentioned, the bug is confirmed. As NicDumZ suggested, please vote up this bug by clicking on

Does this Bug affect you?

to raise attention. Thanks!

UPDATE Feb 20th 2016

As reported first by Ron Thompson and 3vi1 in the comment section; and finally confirmed by myself (using Ubuntu 15.10), this workaround doesn't seem to work anymore, at least not for everyone, after reinstalling google-chrome. Everybody who used this workaround should try to avoid reinstalling chrome.

I again encourage you to say that you are affected by the bug on launchpad (currently 302 people).

UPDATE April 5th 2016 (Working fix!)

A fix has been proposed on launchpad that apparently did the job for a couple of people:

To apply the fix, change line #198 in the file /usr/bin/xdg-settings from

command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/ .*$//'`"

to

command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/ .*$//' | head -n 1`"

UPDATE July 25th 2016 (Working fix!)

Update to the proposed fix for (K)Ubuntu 16.04:

To apply the fix, change lines #177 and #202 in the file /usr/bin/xdg-settings from

command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word"

to

command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word | head -n 1`"

Then go to Google Chrome settings and set Chrome as default browser.

UPDATE Jun 1st 2017

The Bug has been closed and marked as "Fix Released" as of today. Quoting the user Olivier Tilloy (osomon):

If I read the report correctly, the issue was fixed in xdg-utils in xenial. Wily has been EOL for almost a year, so I am closing the bug.

no longer affects: chromium-browser no longer affects: google-chrome-beta (Ubuntu) no longer affects: google-chrome (Ubuntu) Changed in chromium-browser (Ubuntu): assignee: Chad Miller (cmiller) → nobody status: In Progress → Invalid Changed in xdg-utils (Ubuntu): assignee: Chad Miller (cmiller) → nobody status: Confirmed → Fix Released


This has been tracked down as a bug in XDG utilities, and it affects Chromium Browser, too.

See LP Bug #1509139.