Icons Gnome-Shell – How to Remove Duplicate Entries from Dash on 18.04

desktopgnome-shelliconssnap

I'm running Ubuntu 18.04.

I've installed Krita and VLC via the Ubuntu Software store (among other apps). I have enabled multiple repositories as sources for the store.

Krita and VLC are both listed twice in my Dash: once with the appropriate icon from my current theme (Numix), and once with the app's default icon. I'll use Krita as an example for the rest of this post:

Screenshot of two Krita icons side-by-side

No matter which icon I click, the app launches as expected. However, I see different things if I right-click each icon and click "Show Details". If I do this for the Krita icon that matches my system theme, it takes me to a listing for Krita in the software store, sourced from ubuntu-bionic-universe. If I do this on the default-icon version, it searches the store for krita_krita and takes me to a version sourced from Snap Store.

I've looked through my /usr/share/applications folder and reviewed all the entries for Krita in there. There appear to be no duplicates, and only one (org.kde.krita.desktop) that does not have the NoDisplay flag set to true. I also checked out ./local/share/applications to see if there were any entries in there, but that directory contains 0 items.

I've tried uninstalling and reinstalling Krita, to no effect. I also tried rebooting the computer, which also did nothing.

Could having multiple repositories enabled be causing these duplicate listings in my Dash? And how can I remove those extraneous listings?

Best Answer

As you indicate, the two icons you see are connected to two versions of the software, one installed as a regular package, and one installed as a snap, the new software packaging system of Canonical, the company behind Ubuntu.

In principle, it would mean that both versions are installed on your system. It would then be sufficient to remove either the regular version or the snap version using Ubuntu Software. Removing software also takes away the icon. It should do so immediately, but to be sure, log out and log back in to verify whether the icon is gone.

If you are sure you did remove the software, but the icon stays in place, then either you have an icon defined in your user home folder, or something erroneous has happened at some time during the removal. Thus, first check your home folder (see next part in the answer) and if no icon is found there, try to reinstall the software using Ubuntu software, then removing it again hoping the removal is complete this time. If the icon is still not gone, you will have to remove it manually with administration privileges.

At a more technical level

If icons remain even after correctly uninstalling the software, you may want to remove them manually. The icons in the Dash are sourced from program launcher files. These are text files with a .desktop extension that describe how the program should be launched and what icon to use, among other things.

.desktop files can live under the user's home directory in the folder .local/share/applications. These items are only visible for the current user. Such icons are never removed automatically. Thus, if you keep having an icon after removal of software, it is quite likely there is a .desktop file remainng there.

The system wide location for regular application icons is /usr/share/applications. .desktop files for snap applications are maintained under /var/lib/snapd/desktop/applications/. Remove any of the .desktop files there to remove the corresponding icon in the Dash.

Related Question