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.

I have run update-alternatives as well as gnome preffered apps selection thing. And all point to have chromium browser as default. Yet when I run xdg-open http://askubuntu.com firefox is launched! Similarly emacs and bzr also launch stuff in firefox instead of chromium.

Are there any additional settings which affect xdg-open functionality?

Something is definatly broken:

UPDATE
I have purged firefox:
update-alternatives - uses chromium browser
sensible-browser - opens chromium browser
xdg-open & gnome-open - opens using google-chrome which kindly tells me "it's not default browser"

!!!!

share|improve this question
add comment

3 Answers

Chromium also has an option in its preferences to make it the default browser:

alt text

That should work, but it if doesn't, read on:

There are several keys in the GConf database that determine what browser is launched by xdg-open:

  • /desktop/gnome/url-handlers/unknown/command
  • /desktop/gnome/url-handlers/http/command
  • /desktop/gnome/url-handlers/https/command
  • /desktop/gnome/url-handlers/about/command

Make sure they are all set correctly:

  • Hit Alt+F2
  • Enter gconf-editor
  • Navigate to the above keys, they should be set to /usr/bin/chromium-browser %s.

alt text

share|improve this answer
    
This is better. I have removed firefox package and guess what? $ xdg-mime query default text/html firefox.desktop –  Dima Dec 21 '10 at 19:52
add comment

In my situation I installed Chromium and made it default. Before that Chrome was default browser.

I tried all I was able to do: setting Chromium default browser, changing gconf settings to run Chromium with %U variable (http://askubuntu.com/a/41085/94263), changing alternatives to use Chromium as default x-www-browser (http://askubuntu.com/a/24052/94263), but nothing helped, xdg-open opened new Chromium window with start-page ang couldn't open given link, sensible-browser opened Chrome. I tried to purge Chrome (Chromium was automatically set as default and auto in update-alternatives) and install it again, because I need Pepper flash from there, and it became default x-www-browser alternative again, and again was open with sensible-browser command. Then I've googled some pages and drew my attention on priority and also discovered that there is gnome-www-browser symlink in /etc/alternatives/ too and google-chrome was default there. Chrome had priority set in 200 and Chromium - 40. Google Chrome's priority is higher, so update-alternatives utility installs it as default web-browser automatically as "better version".

I've removed both Chrome and Chromium from x-www-browser and gnome-www-browser:

sudo update-alternatives --remove x-www-browser /usr/bin/google-chrome
sudo update-alternatives --remove x-www-browser /usr/bin/chromium-browser
sudo update-alternatives --remove gnome-www-browser /usr/bin/google-chrome
sudo update-alternatives --remove gnome-www-browser /usr/bin/chromium-browser

Then I've installed new alternatives with other priorities:

sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/google-chrome 40
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/chromium-browser 200
sudo update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser /usr/bin/google-chrome 40
sudo update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser /usr/bin/chromium-browser 200

I don't know are '40' and '200' default priorities for all computers or you will have other numbers. It's better to look before by entering

sudo update-alternatives --display x-www-browser
sudo update-alternatives --display gnome-www-browser

Upd. I've tried to do the same things on completely different system, and priorities were the same as here.

Upd2. If you'll run google-chrome just once, it will change it's priority back to 200 but chromium-browser will stay as default.

This worked for me. Chromium was set up as default automatically and sensible-browser is launching Chromium. But still xdg-open is opening new blank window.

share|improve this answer
    
Please, try to improve your answer. You shared a good resource, but you should clarify the information. e.g. you can research the reason of the 40 and 200 numbers. –  Lucio Nov 30 '12 at 1:40
    
Thank You. I tried to write about it a little more. –  mackuz Dec 3 '12 at 20:22
    
Great! And welcome to the community. –  Lucio Dec 3 '12 at 21:09
    
Thank You! Hope, I'll find a complete way to fix this problem some day. –  mackuz Dec 3 '12 at 21:40
add comment

sensible-browser is the command to launch default web browser from the terminal.

share|improve this answer
    
Sure. But I have no clue what $bzr lp-open is using behind my back. But whatever it uses, firefox gets selected. I think it is using xdg-open which also is selecting firefox. –  Dima Dec 21 '10 at 19:24
    
After using DoR fixes, chromium is now opened by sensible-browser. –  Dima Dec 21 '10 at 19:54
    
Glad it worked :) –  karthick87 Dec 21 '10 at 20:00
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.