I've moved from 17.04 to 17.10 (by update, not fresh install)

I have a bunch of customized .desktop files in my desktop.

When I try to run then, I get a message telling me these are "untrusted", and I have to retrust them manually.

Is there a way to trust them all?


  • desktop files have executable bit set (I have run chmod +x).
  • before trusting they appear as a generic file, after with proper icon (e.g. terminal, browser, ...)
  • worked fine before (that is icons and action were OK in 17.04)
  • desktop to samba share are OK.


  • files are not located in /tmp neither in $HOME.

I have read :

Execute-Permission Bit Required

  • Applications, including desktops and shells, must not run executable code from files when they are both:
    • lacking the executable bit
    • located in a user's home directory or temporary directory.
  • my desktop are in neither of those.
  • This includes *.desktop, *.jar, and *.exe files.
  • .desktop files being r--r--r-- or r-xr-xr-x won't execute.
  • Nothing may provide a workaround to run them anyway automatically ...


  • 18.04 problem persist, accepted answer still work.
  • 2
    Possible duplicate of Permission of a .desktop file – JoKeR Oct 25 '17 at 20:45
  • @JoKeR I did set +x bit .. – Archemar Oct 25 '17 at 20:51
  • Did you read the policy from the answer mentioned in that post? – JoKeR Oct 25 '17 at 20:58
  • @JoKeR I have that too, with files which permissions are set to 755 so this is not a dupe, its something new with 17.10 – Videonauth Oct 25 '17 at 21:09
  • might be reported as a bug then... – JoKeR Oct 25 '17 at 21:15

I found my desktop files being mentioned in a binary file called ~/.local/share/gvfs-metadata/home which I could not edit. However, after some digging, I found the gio command. Run the following command followed by doing a refresh in nautilus

gio set yourfile.desktop "metadata::trusted" yes
  • does it work for you? – Pierre.Vriens Jan 14 '18 at 8:04
  • 4
    hardest part was to find F5 command to refresh desktop :( – Archemar Jan 14 '18 at 17:27
  • It worked for me, but only AFTER I did a refresh. This has been an irritation to me for several weeks before I finally found this solution. I hope it works for everyone. – Byron Smith Jan 15 '18 at 3:13
  • for all icons, do this ls -1 ~/Desktop/*.desktop | xargs -i gio set "{}" "metadata::trusted" yes and then hit the F5 key to refresh – knb Oct 24 '18 at 15:22
  • I think this no longer works in 18.04 or 18.10. I don't know what the new solution is. – Byron Smith Dec 28 '18 at 7:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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