Ubuntu – How to get rid of duplicate icons in /usr/share/applications

gnomestartup-applications

As the folder name says /usr/share/applications… are these all my applications installed in the system?

Will deleting a program's icon in below pics mean uninstalling it from the system permanently?

For example, I see Amazon & Cheese icons twice… Files icon thrice

icons in /usr/share/applications

icons in /usr/share/applications

This is a freshly installed Ubuntu 18.04 and I've just installed Audacious, MPV player, Dconf & GNOME Tweaks.

My intention:

  1. How can I know which icon is the actual application that I have to keep? For example I want to remove Amazon completely from my system. Of the two Archive Manager icons, I want to keep the actual working one and remove the other…
  2. How can I know the name of application that can be removed via command line, for example

    sudo apt remove Amazon
    sudo apt remove Audacious Qt Interface 
    sudo apt remove Cheese-not-in-use
    sudo apt remove Files1-not-in-use  
    sudo apt remove Files2-not-in-use  
    

Final Goal:

If I want Audacious, MPV player, Dconf, Files, Cheese, InputMethod, Keyboard, Gparted, Displays, Dock, Disks, Calendar only, then I want to see only 12 icons in this folder.

Is this achievable?

Best Answer

Desktop Entries are either created by the applications or by the user as per his convenience. Not all Desktop Entries refer to application. Remember it might happen a user has created a script and to run that he used a Desktop Entry. So not all desktop entry refer to application. It is also to be noted that not all Desktop Entries are in /usr/share/applications.

  • are these all my applications installed in the system?

    Most probably yes if all these are created by system/application itself. Desktop entries are created at the time of installation of a software (if software knows how to create that like Google Chrome does but Netbeans doesn't).

  • deleting icon in below pics, means uninstalling it from the system permanently?

    Not really. You are just deleting a way (shortcut) to launch a specific application not an application which will still exist after the .desktop file is deleted.

  • how to know which icon is the actual application that i have to keep

    You need to open duplicate desktop entries through a text editor and determine which functionality it offers or for what purpose it is there. Multiple desktop entries must have created multiple shortcuts in app drawer but out of those multiple desktop entries only 1 is visible and every other will be hidden due to NoDisplay=true in their description. That's why only 1 is visible in app drawer. It may also contain a line OnlyShownIn or NotShowIn to show or hide in specific DE.You can learn more about it at Desktop Entry Specification

  • how to know the name of application that can be remove via command line

    For this refer N0rbert's answer

  • if i want Audacious, MPV player, Dconf, Files, Cheese, InputMethod, Keyboard, Gparted, Displays, Dock, Disks, Calendar only then i want to see only 12 icons in this folder.

    No. Some entries like that of Bluetooth are defined by the system and it needs that to properly display it while using a search.