elementary / applications-menu

Applications Menu for elementary OS and the Pantheon desktop environment
https://elementary.io
GNU General Public License v3.0
103 stars 35 forks source link

App appears on Applications Menu but AppCenter says the app is not even installed #408

Open vikasnataraja opened 4 years ago

vikasnataraja commented 4 years ago

Prerequisites

Describe the bug

The Music app is not installed on my computer according to AppCenter and yet it is displayed in the Applications Menu. So, when I click uninstall, it results in an error (see screenshots). Also, the AppCenter sometimes shows the app is indeed installed (even though it's not) so when I click the uninstall button there, the same error occurs. Other times, the AppCenter says the app is not installed.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Music on Applications Menu or AppCenter
  2. Click on Uninstall
  3. See error

I don't have any similar apps that are both shown on the applications menu and not installed except for this Music app so I'm not sure if it's the app that's causing the issue or the menu or the AppCenter.

Expected behavior

The app shouldn't even be shown in the Applications Menu to begin with since AppCenter says it is not installed. There is a discrepancy between the app status in AppCenter and the Applications Menu.

Screenshots or screen recordings

app_uninstall

image

image

image

Platform Information

If you can't please share:

Please check what applies: -->

Additional context

Like I mentioned earlier, maybe this is an issue with AppCenter or with the Music app itself in which case feel free to move this issue to the appropriate repository.

hanaral commented 3 years ago

If you have previously edited an app's launcher, uninstalling it will not get rid of the edited launcher kept in your [~/.local/share/applications] folder. If you previously used AppEditor and changed something about it that would be why.

vikasnataraja commented 3 years ago

@hanaral I've never used the default Music app from elementary and I've definitely not edited the launcher. And I'm not sure what the AppEditor is. Either way, the point I am trying to make with this issue is that there is a discrepancy between an app's status in AppCenter and the local system.

hanaral commented 3 years ago

@vikasnataraja Sorry I seem to have misunderstood, I interpreted as the app seeming like it is installed when it isn't. This is most likely an AppCenter bug then, if you want to remove it you should be able to circumvent the bug by using the command 'sudo apt remove io.elementary.music' in Terminal.

jeremypw commented 3 years ago

I don't suppose the app has been uninstalled and then has been compiled and installed from source by any chance? AppCenter can only show the status of automatically installed programs. It does not know about anything installed manually or some other way that does not update the apt system. However, the Application Menu looks at all the .desktop files and so will show apps installed manually. You could try using the apt-mark commandline program to investigate and alter the status of the noise package.

jeremypw commented 3 years ago

You could also try installing Music with the AppCenter and then uninstalling again. You should also check there are no Music related files installed anywhere under usr/local (usually due to incorrect manual installation) as AppCenter will not handle these.

vikasnataraja commented 3 years ago

@jeremypw The Music app was automatically installed when I started using elementary. and since I've never used it (I use manually compiled Spotify for music), I thought the issue was with elementary's installation process or with the AppCenter. I only discovered this because I had encountered a similar problem with Firefox which I manually installed but the context menu for it would sometimes show the Uninstall option (it still does this occasionally) and intended to post that issue when I saw the issue with Music.

As for the Music app, stranger things continue to happen.

  1. When I open the AppCenter, Music is listed under Installed apps. When I click on it and select Uninstall, it shows me the same error: Application State not set to installed in AppCenter for package: Music. Immediately after I close that pop-up, the status of the Music app in the AppCenter changes to allow me to install by showing me that it's Free. When I select that and install it, it is seamless but when I try to immediately uninstall it, the whole process repeats.

  2. All the while, Music is still listed in App Menu on the top left. The app opens flawlessly and it appears I can use the app as intended. However, when I go to the context menu and select Uninstall, the same error occurs. If I select View in AppCenter instead, it takes me there and the app status is listed as installed but when I try to uninstall it, same error pops up.

  3. I found a file: /usr/share/applications/io.elementary.music.desktop which is obviously write protected. When I removed it, the Music app did finally go away from the App Menu (but that's just the launcher icon anyway) but the AppCenter still shows the app as installed since only the launcher icon is gone now. Furthermore, that .desktop file reappears every time I try to delete it but the icon from the App Menu is definitely gone.

hanaral commented 3 years ago

@vikasnataraja Removing the .desktop file doesn't remove the app, just the launcher icon. It sounds like for whatever reason the AppCenter does not have state set for an app that comes preinstalled. Try running the sudo apt remove io.elementary.music I mentioned before to manually remove it, and then reinstall it through the AppCenter.

vikasnataraja commented 3 years ago

@hanaral That's just it, there is no io.elementary.music on my computer that I could find and I can't even uninstall it via the AppCenter GUI because of the issue I mentioned above.

jeremypw commented 3 years ago

@vikasnataraja Have you tried sudo apt purge noise from the command line? Might be worth running sudo apt autoclean and sudo apt autoremove as well. Note noise is the package name for the Music app whereas io.elementary.music is the name of the executable that gets installed by the package. You could use Synaptic to get more detailed information about the state of the package system.

vikasnataraja commented 3 years ago

Still no luck despite experimenting with what @jeremypw suggested. I'll put a pin on it for now and come back to it later.