Removing menu items of software that were not removed on uninstall

How do I remove menu items of software that did not remove on uninstall?

We need a little more information.

What version of fedora?
What package was installed then removed?
Where is the “menu item” remaining?
Is the menu item actually the item icon in the activities menu or was it a self-created item?
Was the package installed from fedora? or from a 3rd party repo? or maybe from github?
How was it installed?

1 Like

If it is the icon on the task manager then just right click the task manager and click the “unpin from task manager” button on the context menu.

This removes it from the task bar, but does not remove it from the activities menu. Removing an installed package should remove the icon and .desktop files that were installed by that package. This is why I asked the questions above.

Menu/Internet and there it is. I have the Flatpak version but when I deleted the Icon I deleted accidentally the Flatpak Icon fortunately I have copied it to the software bar. If It in the /bin directory on was Vivaldi and the other Vivaldi stable. I though it would remove the original and replace with the Flatpak. That is the way things worked before.

Software installation & removal is different on fedora than on other distros.

Fedora relies on the ‘dnf’ package manager (or one of the gui software managers depending upon which spin you may have installed) to install & remove software. Removing files from the /bin directory is certain to break things, especially with the gui desktop and the activity menu.

1 Like

Okay this is not the first time I went to software to uninstall and it left the menu listing from there was all down hill. This all started when I installed the flatpak version. Instead of over writing the listing it added it and was not functional. I just want to uninstall keep my files and reinstall so it works. But! Sheesh! Who writes these things anyway.

Now when I reinstall I have to go to software open the listing and then click run. And now after many tries including running the uninstall in the software it doesn’t remove anything. and nothing changes. this is like turning the key on in the car and instead of firing up the fires go flat.

I’m not sure about flatpaks, but for traditional/normal software installed via RPM packages, the menu icons mostly come from /usr/share/applications and ~/.local/share/applications. If a package was uninstalled but it did not remove its .desktop file, you can manually remove the .desktop file to get rid of the menu icon.

Use rpm -qf <path-to-desktop-file> before manually removing a .desktop file to be sure that the associated package has been uninstalled. For example:

$ rpm -qf /usr/share/applications/gvim.desktop
file /usr/share/applications/gvim.desktop is not owned by any package
$ sudo rm /usr/share/applications/gvim.desktop
$ sudo update-desktop-database /usr/share/applications

If, however, the file is still owned by an installed package, you should not remove the file manually. You should uninstall the package with sudo dnf remove <package-name>. For example:

$ rpm -qf /usr/share/applications/java-1.8.0-openjdk-1.8.0.412.b06-1.fc39.x86_64-jconsole.desktop
java-1.8.0-openjdk-devel-1.8.0.412.b06-1.fc39.x86_64
$ sudo dnf remove java-1.8.0-openjdk-devel
Dependencies resolved.
====================================================================================================================================================================================================================
 Package                                                     Architecture                              Version                                                    Repository                                   Size
====================================================================================================================================================================================================================
Removing:
 java-1.8.0-openjdk-devel                                    x86_64                                    1:1.8.0.412.b06-1.fc39                                     @updates                                     41 M

Transaction Summary
====================================================================================================================================================================================================================
Remove  1 Package

Freed space: 41 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                            1/1 
  Erasing          : java-1.8.0-openjdk-devel-1:1.8.0.412.b06-1.fc39.x86_64                                                                                                                                     1/1 
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.412.b06-1.fc39.x86_64                                                                                                                                     1/1 
  Verifying        : java-1.8.0-openjdk-devel-1:1.8.0.412.b06-1.fc39.x86_64                                                                                                                                     1/1 

Removed:
  java-1.8.0-openjdk-devel-1:1.8.0.412.b06-1.fc39.x86_64                                                                                                                                                            

Complete!
$ ls /usr/share/applications/java-1.8.0-openjdk-1.8.0.412.b06-1.fc39.x86_64-jconsole.desktop
ls: cannot access '/usr/share/applications/java-1.8.0-openjdk-1.8.0.412.b06-1.fc39.x86_64-jconsole.desktop': No such file or directory

Thank you it removed the mess. I went to the software and installed it again that shows it as flathum. When I did install it and rebooted. the menu item was not there.

This should be expected. Having a package installed by rpm should provide the icon for launching it. Having a package installed as flatpak should also create its launcher and icon.
There should be 2 different icons since they launch 2 different versions of the same app (one from rpm and one from flatpak.

Your issue seems that you chose to remove the launcher and not the app itself (which likely would have removed the proper matching launcher that it installed when the package was installed).

The only time I am aware of where removing a package (either flatpak or rpm) does not remove the launcher would be if the user had customized the launcher and thus copied the package launcher into ~/.local/share/applications. In that case the .desktop file under the users home directory would not be removed with the uninstall but your case seems you manually deleted the launcher and chose the wrong one.

A missing launcher (.desktop file) can usually be restored by a simple reinstall of the appropriate package dnf reinstall <package name> or flatpak reinstall <package name> depending upon the package being reinstalled.

Added gnome