Getting this error as regular user:

~$ xdg-open http://www.google.com/
xdg-open: no method available for opening 'http://www.google.com/'
~$ xdg-mime query default text/html

Code from /usr/bin/xdg-open

  # if BROWSER variable is not set, check some well known browsers instead
    if [ x"$BROWSER" = x"chromium" ]; then
        if [ -n "$DISPLAY" ]; then

    open_envvar "$1"

    exit_failure_operation_impossible "no method available for opening '$1'"

Operating system: Ubuntu 16.04 Gnu/Linux

  • 2
    Why are you doing this as root? Does it work as expected if you do it as a regular user? You say "code modified", what code? Where? How did you modify it?
    – terdon
    Apr 11, 2020 at 13:43
  • It didnt work as a regular user
    – xavier96
    Apr 11, 2020 at 13:48
  • 1
    OK, then please edit your question and show what happens when you do it as a regular user instead of root since root is a very special case. And please also explain what the code you are showing is, where it is from, why it is relevant and how you changed it.
    – terdon
    Apr 11, 2020 at 13:52
  • 1
    Also, what is the output of xdg-mime query default text/html and what browsers do you have installed? Is this Ubuntu server? Do you have a working graphical environment?
    – terdon
    Apr 11, 2020 at 13:58

1 Answer 1


The MIME type xdg-open uses for URIs is x-scheme-handler/<scheme>, in your case x-scheme-handler/http and x-scheme-handler/https. You can put an entry for those using your desired .desktop file in your



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .