Does updating applications affect .desktop files?

I was wandering if .desktop files are affected when an application is updated or just the /usr/bin/* files? I’m making an menu with customized categories and it’s not gonna work is the categories in .desktop files are reset to default when an application is updated.

Asked By: Maud Kon

||

The .desktop files is in really part of the package itself, so of course the .desktop will b updated within the package.

Indeed the .desktop files can be found in these different places:

  1. /usr/share/applications

  2. /usr/share/app-install/desktop

  3. ~/.local/share/applications

  4. /var/lib/snapd/desktop/applications

  5. /var/lib/flatpak/exports/share/applications and ~/.local/share/flatpak/exports/share/applications if using Flatpak

  6. and the applications subdirectory of any directory listed in the environment variable XDG_DATA_DIRS:

    echo $XDG_DATA_DIRS
    

But be care for some tips:

The .desktop in the /usr/share/applciations and those in /usr/share/app-install/desktop will be updated since those are related to system wide and those .desktop files are created when installing via apt-get or Ubuntu Software Center.

But to make sure that your file will not change you can put it in ~/.local/share/applications, as those directories are for the user himself, so it’ll not be changed unless you did it.

Related question: Why are there redundant directories for .desktop files?

Answered By: Maythux
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.