xdg-open stopped working since 16.04 upgrade

xdg-mime query default inode/directory

correctly gives me:

nemo.desktop

like I expect, and want it to.

But

xdg-open $HOME

Gives an error:

xdg-mime: mimetype argument missing
Try 'xdg-mime --help' for more information.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (.*?)}/ at /usr/bin/run-mailcap line 528.
Warning: program returned non-zero exit code #66

...and opens Audacious.

I tried editing the run-mailcap line to escape the braces, and that gets rid of that error message. But it doesn't fix the problem. I still get "mimetype argument missing" and the wrong program opens.

I tried uninstalling Audacious, and it opens a different wrong program instead (git-cola and chrome).

I tried sudo apt-get install --reinstall xdg-utils and it didn't change anything.

edit: more information, the above described behavior happens in both Cinnamon and Gnome, but not in Lubuntu LXDE. In LXDE, the query gives nemo.desktop, and xdg-open does not produce any error messages in the terminal, but it opens PCManFM (not nemo).

Is that a clue to what is wrong or how to fix it?


I had exactly the same problem.
I could solve the problem by just install gvfs-bin (nothing more)...

sudo apt install gvfs-bin

I found this out, because in the log-files from user Amias is to read:
gvfs-open /home/amias

But gvfs-open was not installed on my system.

After installing gvfs-bin, it works!

To set a new file association (e.g use Nemo for folders), you can do:

gvfs-mime --set inode/directory nemo.desktop

-Cheers


Okay, it seems as though a patch was released for others having similar issues judging by this article: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810587

In this article the person was encountering:

"Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (.*?)}/ at /usr/bin/run-mailcap line 528."

while running nmh which seems similar to your error message except for a different program. So I would recommend running:

sudo apt-get upgrade;sudo apt-get dist-upgrade

As the affected package might have an upgraded version available with the patch.

I hope this helps.

NOTE: This will upgrade all packages that can be upgraded (which is a good thing regardless) so don't be suprised if multiple packages want to upgrade.