Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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. –  Gilles Feb 21 at 11:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.