12

After upgrading to Ubuntu 14.04 from 12.04 I have duplicate entries in dash.

enter image description here

How can I get rid of them?

0

1 Answer 1

29

In Dash, applications are represented by .desktop files. These files are located in either /usr/share/applications or ~/.local/share/applications. For snap programs, also look at /var/lib/snapd/desktop/applications

What you see in Dash is not the filename of these .desktop files, but the (application-) name that is defined in the Name= line, inside the file.

When you have duplicate appearances of the same application in Dash, it almost certainly means that you have desktop files in either /usr/share/applications or ~/.local/share applications (or even the snap folder) with a different file name, but representing the same application, and with the same Name= line.

This is for example the result when I copy the gedit.desktop file, rename it to monkey.desktop and copy it into /usr/share/applications:

enter image description here

In your case it is probably the result of installed new versions of applications you already had installed, these new versions install new .desktop files, but with a slightly different (file-)name.

What you should do is look inside both directories, find these "almost duplicate" .desktop files, remove the oldest and keep the latest.

Some more information

From the two locations: /usr/share/applications and ~/.local/share/applications, the latter takes precedence. If two .desktop files with the same filename exist in both directories, the local one shows up in Dash (if just copied, it takes a logout / login). That is why it is normally good practice to first copy a .desktop file to the local directory (to add items to the launcher's quicklist for example) before editing, and leave the global one untouched.

If you install a newer version of some software, and the newly installed .desktop file name differs from the old one (and the old one is not removed for some reason), the application will have multiple occurrences in Dash. The same happens when the .desktop file is replaced, but people forget they have a local (edited) version of the .desktop file.

3
  • 1
    Thank you! I didn't have any .desktop files in ~/.local/share applications just similar files in /usr/share/applications.
    – user244647
    Aug 26, 2014 at 18:27
  • That is very well possible! I will add some information to my answer. Aug 26, 2014 at 18:32
  • For snap programs, check /var/lib/snapd/desktop/applications Jun 3, 2019 at 18:58

You must log in to answer this question.

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