How do I get rid of a duplicate application?

When I search my Applications for Discord I see 2 versions (see screenshot).

One opens Discord normally. The other prompts me to download an update then disappears. If I download the update and run it prompts me to Remove discord.

If I Remove discord, I just end up with the version that prompts me to download a new update.

Any suggestions how I can clean this mess up?enter image description here

At the bare minimum, I'd like to delete the faulty app (which I'm currently unable to do). I've sunk too many hours trying to delete the faulty app or mistakenly clicking on it.

I don't see it in ~/.local/share/applications/ or /usr/share/applications/ or /usr/local/share/applications/ btw.


Solution 1:

There are multiple ways to install applications in Ubuntu. For example, you can copy the application's file to the places they need to go manually, you can install a Debian package, you can install an application via Snap and others. If you install the same application with two or more of these methods, you can end up with multiple copies of the same application. Probably, this is what happened here.

Chances are, you installed one copy of the Discord client from a Debian package (a file ending with .deb) and another copy via Snap. You can check that with

dpkg -l '*discord*'

(I'm not aware of an official apt repository for Discord, so I'll stay on the dpkg layer for this answer)

If this prints a line for discord starting with ii, there's a copy of the Discord client installed from a Debian package. It should look similar to

ii  discord        0.0.11       amd64        All-in-one voice and text chat for gamers

Regarding Snap, you can list the installed Snaps with

snap list

The list printed by this command probably contains an entry for the Discord client, as well.

You can remove the reduntant installation with

dpkg -r discord

or

snap remove discord

respectively.

To find out which copy is working and which isn't, you just have to try. If you uninstalled the "wrong" copy, you just need to reinstall it. This is done by downloading the *.deb file from [https://discord.com/new](Discord's home page) and installing that with something similar to

dpkg -i discord-0.0.11.deb

or

snap install discord

respectively.