Ubuntu – Deleted all three ‘Files’ .desktop files in /usr/share/applications/ – how to get them back


Whilst trying to fix a bug that gave me two occurrences of the 'Files' shortcut on the dash, one of which would never go away without a reboot, I navigated to /usr/share/applications/ and deleted all three desktop configuration files titled 'Files'. It turns out that none of these three were identical. One was 'org.gnome.Nautilus.desktop', another was 'nautilus-folder-handler.desktop', and the last was 'nautilus.desktop'. I've got no idea which of these were important, but now that they're gone it's broken a few things. How can I get them back?

Best Answer

You could reinstall nautilus package with

sudo apt install --reinstall nautilus

This will give you back the /usr/share/applications/org.gnome.Nautilus.desktop file. I don't know where the others come from.

Try to look for them with apt-file

apt-file search /usr/share/applications/nautilus-folder-handler.desktop


 apt-file search /usr/share/applications/nautilus.desktop

Of course, you need apt-file installed. sudo apt install apt-file