Flameshot snap package cannot be removed

Asked by Stephen

I have two installations of Flameshot. One of this is a snap package, and the other not. I seek to remove the snap package, and retain only the one that is not snapped. I know I have two installations because when I do a search for Flameshot using "Show Applications" which is the lower left 3 dot by 3 dot icon, I get hits for both installations, and the icon for one of these hits shows it is a snap package. Both icons in the search results work to launch their Flameshot versions.

When attempt to remove the snapped one in the command line I get this response:

stephen@stephen:~$ sudo snap remove flameshot
snap "flameshot" is not installed

When I search for Flameshot in Discover I see two versions are available. The one that is not a snap shows as already installed. The one that is a snap package it shows as not installed, which is seemingly false.

I attempted to install, and then remove, the snap package version in Discover on the theory that the installation would overwrite the already installed version, and then make this snap version removable. This did not work because the snap package would not install. The progress bar appears briefly, and completes. When it disappears the Install button did not change to Remove. This indicates the Discover did not succeed at installing it.

Why am I not able to remove the Flameshot snap package? If I had to resort to a manual removal how would this be done?

Ubuntu 22.04

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes, what output do you receive for the following commands (to be executed in a terminal window):

uname -a
lsb_release -crid
dpkg -l | grep -i flames
snap list -all
command -v flameshot

Revision history for this message
Stephen (artist-wavenet) said :
#2

stephen@stephen:~$ uname -a
Linux stephen.tower 5.17.0-1020-oem #21-Ubuntu SMP PREEMPT Fri Oct 14 09:33:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
stephen@stephen:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
stephen@stephen:~$ dpkg -l | grep -i flameshot
ii flameshot 11.0.0-2 amd64 Powerful yet simple-to-use screenshot software
stephen@stephen:~$ snap list -all
error: unknown flag `a'
stephen@stephen:~$ command -v flameshot
/usr/bin/flameshot

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Sorry, my fault, please repeat the failing command with a double dash,

snap list --all

Revision history for this message
Stephen (artist-wavenet) said :
#4

stephen@stephen:~$ snap list --all
Name Version Rev Tracking Publisher Notes
bare 1.0 5 latest/stable canonical✓ base
core18 20230426 2745 latest/stable canonical✓ base
core18 20230320 2721 latest/stable canonical✓ base,disabled
core20 20230503 1891 latest/stable canonical✓ base
core20 20230404 1879 latest/stable canonical✓ base,disabled
core22 20230503 634 latest/stable canonical✓ base
core22 20230404 617 latest/stable canonical✓ base,disabled
discord 0.0.26 151 latest/stable snapcrafters disabled
discord 0.0.27 153 latest/stable snapcrafters -
eclipse 2022-12 66 latest/stable snapcrafters classic
eclipse 2022-09 64 latest/stable snapcrafters disabled,classic
firefox 113.0-2 2645 latest/stable mozilla✓ disabled
firefox 113.0.1-1 2667 latest/stable mozilla✓ -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 194 latest/stable canonical✓ disabled
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 198 latest/stable canonical✓ -
gnome-3-38-2004 0+git.6f39565 140 latest/stable canonical✓ -
gnome-3-38-2004 0+git.6f39565 137 latest/stable canonical✓ disabled
gnome-42-2204 0+git.587e965 99 latest/stable canonical✓ disabled
gnome-42-2204 0+git.587e965 102 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ -
hunspell-dictionaries-1-7-2004 1.7-20.04+pkg-6fd6 2 latest/stable brlin -
losslesscut 3.49.0 114 latest/stable mifino -
ocrthypdf v0.7.0-19-g05187b7 125 latest/stable digidigital-software disabled
ocrthypdf v0.7.0-19-g05187b7 126 latest/stable digidigital-software -
snapd 2.59.2 19122 latest/stable canonical✓ snapd
snapd 2.59.1 18933 latest/stable canonical✓ snapd,disabled

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Did you follow this to install the snap version
https://flameshot.org/docs/installation/installation-linux/

?

Revision history for this message
Stephen (artist-wavenet) said :
#6

It is the flameshot snap package I want removed. The instructions at:
https://flameshot.org/docs/installation/installation-linux/
install the non-snap version.

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

There is no snap version of Flamshot visible on your system. What indication do you see, that you have the snap version installed in addition to the Ubuntu-provided version?

Revision history for this message
Stephen (artist-wavenet) said (last edit ):
#8

This is a screenshot (taken with Flameshot) of the search results in the "Show Applications" function:
https://i.imgur.com/1FfYwdt.png
"Show Applications" is the 3 x 3 dot icon in the favorites bar.

As you can see the screenshot shows the icons of two versions of Flameshot, and one of these is identified as the snap version. Both these icons work to launch their versions.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

What is the output of:

grep -R -i flame /usr/share/applications/*

Revision history for this message
Bernard Stafford (bernard010) said :
#10

"There is no snap version of Flamshot visible on your system"
I would right click on the icon identified as a snap icon and select delete.

Revision history for this message
Stephen (artist-wavenet) said (last edit ):
#11

There are two installations of Flameshot. There is one icon for each of them in that screenshot. I know they invoke different installations because one of them opens its GUI immediately upon launch. The other does not, and does instead put an icon in the system tray which must be clicked on to get the GUI. I am not in favor of deleting one of the icons because it would not remove the installation it launches. Furthermore, the screenshot shows a search result. A search result is not like a desktop where a launcher on it can be deleted.

stephen@stephen:~$ grep -R -i flame /usr/share/applications/*
/usr/share/applications/Flameshot.desktop:Exec=flameshot launcher
/usr/share/applications/Flameshot.desktop:Icon=flameshot
/usr/share/applications/Flameshot.desktop:Name=Flameshot (Snappy Edition)
/usr/share/applications/org.flameshot.Flameshot.desktop:Name=Flameshot
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords=flameshot;screenshot;capture;shutter;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[zh_CN]=flameshot;screenshot;capture;shutter;截图;屏幕;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[fr]=flameshot;capture d'écran;capter;shutter;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[ja]=flameshot;screenshot;capture;shutter;スクリーンショット;キャプチャー;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[nl]=flameshot;schermfoto;screenshot;schermafdruk;vastleggen;schermopname;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[nl_NL]=flameshot;schermfoto;screenshot;schermafdruk;vastleggen;schermopname;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[es]=flameshot;screenshot;capture;shutter;captura;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[de]=flameshot;screenshot;Bildschirmfoto;Aufnahme;
/usr/share/applications/org.flameshot.Flameshot.desktop:Keywords[pt_BR]=flameshot;screenshot;captura de tela;captura;shutter;
/usr/share/applications/org.flameshot.Flameshot.desktop:Exec=/usr/bin/flameshot
/usr/share/applications/org.flameshot.Flameshot.desktop:Icon=org.flameshot.Flameshot
/usr/share/applications/org.flameshot.Flameshot.desktop:StartupWMClass=flameshot
/usr/share/applications/org.flameshot.Flameshot.desktop:X-DBUS-ServiceName=org.flameshot.Flameshot
/usr/share/applications/org.flameshot.Flameshot.desktop:Exec=flameshot config
/usr/share/applications/org.flameshot.Flameshot.desktop:Exec=flameshot gui --delay 500
/usr/share/applications/org.flameshot.Flameshot.desktop:Exec=flameshot launcher

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

What is the output of the commands

ls -l /var/snap
ls -l /usr/bin/*flames*

Revision history for this message
Stephen (artist-wavenet) said :
#13

stephen@stephen:~$ ls -l /var/snap
total 135
drwxr-xr-x 4 root root 5 Sep 1 2022 bare
drwxr-xr-x 5 root root 6 May 7 18:15 core18
drwxr-xr-x 5 root root 6 May 18 05:34 core20
drwxr-xr-x 5 root root 6 May 12 20:49 core22
drwxr-xr-x 5 root root 6 Apr 28 21:44 discord
drwxr-xr-x 5 root root 6 Dec 10 17:24 eclipse
drwxr-xr-x 5 root root 6 May 12 08:09 firefox
drwxr-xr-x 5 root root 6 Apr 16 16:42 gnome-3-28-1804
drwxr-xr-x 5 root root 6 Apr 26 21:04 gnome-3-38-2004
drwxr-xr-x 5 root root 6 May 5 21:58 gnome-42-2204
drwxr-xr-x 4 root root 5 Sep 1 2022 gtk-common-themes
drwxr-xr-x 4 root root 5 Sep 20 2022 hunspell-dictionaries-1-7-2004
drwxr-xr-x 4 root root 5 Mar 8 11:50 losslesscut
drwxr-xr-x 5 root root 6 May 17 08:15 ocrthypdf
drwxr-xr-x 5 root root 6 May 6 12:13 snapd

stephen@stephen:~$ ls -l /usr/bin/*flames*
-rwxr-xr-x 1 root root 1255936 Jan 14 2022 /usr/bin/flameshot
stephen@stephen:~$

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#14

There is nothing shown about a flameshot snap installation on your system, neither by the snap list command, nor in the directory where all active snap files are stored.

My assumption is now, that there might have been a snap installation once, but the only thing left is the "Flameshot (Snappy Edition)" desktop file.

Remark to your statement "I know they invoke different installations because one of them opens its GUI immediately upon launch. The other does not, and does instead put an icon in the system tray which must be clicked on to get the GUI.":

You can use the Ubuntu *.deb version of flameshot in several modes, e.g. make a screen shot immediately, open a dialogue to select the area, as well as run in background with just an icon in the notification area. see https://manpages.ubuntu.com/manpages/jammy/en/man1/flameshot.1.html#subcommands

I assume that there is only one (*.deb) installation on your system, and the two desktop starter files activate two different modes.

Revision history for this message
Stephen (artist-wavenet) said :
#15

I have verified what you have said by launching from each icon, and using the ps, and which, commands:

stephen@stephen:~$ ps aux | grep flameshot
stephen 368132 0.2 0.0 2626568 85060 ? Sl 11:35 0:00 flameshot launcher
stephen 369132 0.0 0.0 6476 1508 pts/0 S+ 11:36 0:00 grep --color=auto flameshot
stephen@stephen:~$ ps aux | grep flameshot
stephen 370118 1.0 0.0 595224 50868 ? Sl 11:37 0:00 /usr/bin/flameshot
stephen 370402 0.0 0.0 6608 1532 pts/0 S+ 11:37 0:00 grep --color=auto flameshot
stephen@stephen:~$ which flameshot
/usr/bin/flameshot

And you are right about there being two launchers:

stephen@stephen:~$ find /usr/share/applications -iname *flameshot*
/usr/share/applications/Flameshot.desktop
/usr/share/applications/org.flameshot.Flameshot.desktop

I just need to remove one.

Thanks for your help. :)

Revision history for this message
Stephen (artist-wavenet) said :
#16

Thanks Manfred Hampl, that solved my question.