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.
  • 19.04 problem persist, accepted answer no longer work (you must replace yes by true, however after reboot, .desktop not executable)
  • 20.04 use true instead of yes in accepted answer, or right-click "allow execution" from desktop (this might be troublesome for generated .desktop)
  • 2
    Possible duplicate of Permission of a .desktop file
    – JoKeR
    Commented Oct 25, 2017 at 20:45
  • @JoKeR I did set +x bit ..
    – Archemar
    Commented Oct 25, 2017 at 20:51
  • Did you read the policy from the answer mentioned in that post?
    – JoKeR
    Commented Oct 25, 2017 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
    Commented Oct 25, 2017 at 21:09
  • might be reported as a bug then...
    – JoKeR
    Commented Oct 25, 2017 at 21:15

1 Answer 1


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? Commented Jan 14, 2018 at 8:04
  • 4
    hardest part was to find F5 command to refresh desktop :(
    – Archemar
    Commented Jan 14, 2018 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. Commented Jan 15, 2018 at 3:13
  • 1
    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
    Commented Oct 24, 2018 at 15:22
  • 1
    I think this no longer works in 18.04 or 18.10. I don't know what the new solution is. Commented Dec 28, 2018 at 7:13

You must log in to answer this question.

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