Snap remove audacity : errors?

Hello,

my system warned me about storage almost full 21G out of 24G used on my / ( my personal files are on another disk ) so I try to tidy up here and there.

And trying to remove audacity I don’t use these days, I get :

django@ASGARD:~$ sudo snap remove audacity 
[sudo] Mot de passe de django : 
erreur : cannot perform the following tasks:
- Supprimer le profil de sécurité du paquet Snap "audacity" (675) (cannot find installed snap "audacity" at revision 675: missing file /snap/audacity/675/meta/snap.yaml)
- Supprimer les données du paquet Snap "audacity" (669) (failed to remove snap "audacity" base directory: remove /var/snap/audacity: directory not empty)
- Déconnecter audacity:home de core:home (snap "audacity" has no "home" plug)
- Déconnecter audacity:gsettings de core:gsettings (snap "audacity" has no "gsettings" plug)
- Déconnecter audacity:desktop de core:desktop (snap "audacity" has no "desktop" plug)
- Déconnecter audacity:gtk-2-themes de gtk-common-themes:gtk-2-themes (snap "audacity" has no "gtk-2-themes" plug)
- Déconnecter audacity:gtk-2-themes de adapta-theme-colorpack:gtk-2-themes (snap "audacity" has no "gtk-2-themes" plug)
- Déconnecter audacity:audio-record de core:audio-record (snap "audacity" has no "audio-record" plug)
- Déconnecter audacity:pulseaudio de core:pulseaudio (snap "audacity" has no "pulseaudio" plug)
- Déconnecter audacity:sound-themes de gtk-common-themes:sound-themes (snap "audacity" has no "sound-themes" plug)
- Déconnecter audacity:icon-themes de adapta-gtk-snap:icon-themes (snap "audacity" has no "icon-themes" plug)
- Déconnecter audacity:icon-themes de gtk-common-themes:icon-themes (snap "audacity" has no "icon-themes" plug)
- Déconnecter audacity:removable-media de core:removable-media (snap "audacity" has no "removable-media" plug)
- Déconnecter audacity:wayland de core:wayland (snap "audacity" has no "wayland" plug)
- Déconnecter audacity:unity7 de core:unity7 (snap "audacity" has no "unity7" plug)
- Déconnecter audacity:gtk-2-engines de gtk2-common-themes:gtk-2-engines (snap "audacity" has no "gtk-2-engines" plug)
- Déconnecter audacity:audio-playback de core:audio-playback (snap "audacity" has no "audio-playback" plug)
- Déconnecter audacity:desktop-legacy de core:desktop-legacy (snap "audacity" has no "desktop-legacy" plug)
- Déconnecter audacity:x11 de core:x11 (snap "audacity" has no "x11" plug)
django@ASGARD:~$ 

Audacity is now disabled, but still there :

django@ASGARD:~$ sudo snap refresh
[sudo] Mot de passe de django : 
Tous les paquets Snaps sont à jour.
django@ASGARD:~$ snap list
Nom                     Version                     Révision  Suivi            Éditeur       Notes
adapta-gtk-snap         0.2                         10        latest/stable    kd913         -
adapta-theme-colorpack  3.94.0.149                  1         latest/stable    gantonayde    -
audacity                2.4.1                       669       latest/beta      diddledan     désactivé
chromium                83.0.4103.116               1213      latest/stable    canonical✓    -
core                    16-2.45.1                   9436      latest/stable    canonical✓    core
core18                  20200427                    1754      latest/stable    canonical✓    base
core20                  20                          634       latest/stable    canonical✓    base
gimp                    2.10.20                     281       latest/stable    snapcrafters  -
gnome-3-28-1804         3.28.0-17-gde3d74c.de3d74c  128       latest/stable    canonical✓    -
gtk-common-themes       0.1-36-gc75f853             1506      latest/stable    canonical✓    -
gtk2-common-themes      0.1                         13        latest/stable    canonical✓    -
ubuntu-budgie-welcome   0.12.6                      209       latest/stable/…  ubuntubudgie  classic

In same kind of ideas how do I keep only current version of a snap ( I have 2 versions of gimp and chromium )

ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help                                                                                                                                                  
--- /snap/chromium ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                         /..                                                                                                                                                                                    
  570,0 MiB [##########] /1213
  570,0 MiB [######### ] /1193
@   0,0   B [          ]  current

and

ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help                                                                                                                                                  
--- /snap/gimp -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                         /..                                                                                                                                                                                    
  516,6 MiB [##########] /281
  515,6 MiB [######### ] /273
@   0,0   B [          ]  current

Any recommendations ?

Any recommendations

  1. Buy more storage.
  2. Automate cleaning process. snap list --all | grep disabled show disabled second revision and snap remove <SNAP> --revision=<REVISION> removes specified revision only. Clear cached deb packages, reduce logging…

Buy more storage.
How arrogant.

More seriously, am on multi-boot, so each / is about 30 Go which used to be enough for my usage but nowadays it becomes short.

After few months, Ubuntu 20.04 is already at 85% of its storage - is there any growth ?
It may not be snap’s fault here.

I did some of your suggestions. What do you mean by « reduce logging » ?

django@ASGARD:~$ df -Th | grep -v loop
Sys. de fichiers Type     Taille Utilisé Dispo Uti% Monté sur
udev             devtmpfs   7,8G       0  7,8G   0% /dev
tmpfs            tmpfs      1,6G    2,3M  1,6G   1% /run
/dev/sda1        ext4        24G     19G  3,7G  84% /
tmpfs            tmpfs      7,8G    120M  7,7G   2% /dev/shm
tmpfs            tmpfs      5,0M    4,0K  5,0M   1% /run/lock
tmpfs            tmpfs      7,8G       0  7,8G   0% /sys/fs/cgroup
/dev/sdb1        ext4       917G    495G  376G  57% /media/DATA
tmpfs            tmpfs      1,6G     64K  1,6G   1% /run/user/1000

django@ASGARD:~$ snap list --all
Nom                     Version                     Révision  Suivi            Éditeur       Notes
adapta-gtk-snap         0.2                         10        latest/stable    kd913         -
adapta-theme-colorpack  3.94.0.149                  1         latest/stable    gantonayde    -
audacity                2.4.1                       669       latest/beta      diddledan     désactivé
chromium                83.0.4103.116               1213      latest/stable    canonical✓    -
core                    16-2.45.1                   9436      latest/stable    canonical✓    core
core18                  20200427                    1754      latest/stable    canonical✓    base
core20                  20                          634       latest/stable    canonical✓    base
gimp                    2.10.20                     281       latest/stable    snapcrafters  -
gnome-3-28-1804         3.28.0-17-gde3d74c.de3d74c  128       latest/stable    canonical✓    -
gtk-common-themes       0.1-36-gc75f853             1506      latest/stable    canonical✓    -
gtk2-common-themes      0.1                         13        latest/stable    canonical✓    -
ubuntu-budgie-welcome   0.12.6                      209       latest/stable/…  ubuntubudgie  classic

django@ASGARD:~$ sudo du -csh /snap/* |sort -rh
[sudo] Mot de passe de django : 
3,5G	total
614M	/snap/gnome-3-28-1804
570M	/snap/chromium
517M	/snap/gimp
465M	/snap/audacity
312M	/snap/gtk-common-themes
286M	/snap/core
248M	/snap/adapta-theme-colorpack
195M	/snap/core20
168M	/snap/core18
87M	/snap/adapta-gtk-snap
34M	/snap/ubuntu-budgie-welcome
427K	/snap/gtk2-common-themes
4,0K	/snap/README
4,0K	/snap/bin
django@ASGARD:~$ 

Oh wait. Why Audacity’s still there ?

django@ASGARD:~$ snap remove audacity --revision=669
erreur : cannot perform the following tasks:
- Supprimer les données du paquet Snap "audacity" (669) (failed to remove snap "audacity" base directory: remove /var/snap/audacity: directory not empty)
django@ASGARD:~$ 

I deleted this, now I can remove audacity revision 669 but…

django@ASGARD:~$ df -Th | grep -v loop*
Sys. de fichiers Type     Taille Utilisé Dispo Uti% Monté sur
(…)
/dev/sda1        ext4        24G     21G  2,0G  92% /
(…)
django@ASGARD:~$ 

And get it, the restore feature…

django@ASGARD:~$ snap saved
Ensemble  Snap      Âge      Version               Version  Taille  Notes
4         sayonara  4j12h    1.6.0-beta6-21020349  55        161MB  auto
8         audacity  19.5min  2.4.1                 669        837B  auto

django@ASGARD:~$ snap forget 4
Snapshot #4 forgotten.
django@ASGARD:~$ snap forget 8
Snapshot #8 forgotten.

django@ASGARD:~$ df -Th | grep -v loop*
Sys. de fichiers Type     Taille Utilisé Dispo Uti% Monté sur
(…)
/dev/sda1        ext4        24G     19G  4,1G  82% /
(…)
django@ASGARD:~$ 

Finally, snap needs much storage because of its versions + restore features.

Now if I look at the size in snap saved and storage gained in my /, numbers do not match. Why ?

What do you mean by « reduce logging »

journalctl --disk-usage

It’s funny you mentioned journalctl as I noticed it takes some space indeed :

django@ASGARD:~$ journalctl --disk-usage
Archived and active journals take up 1.4G in the file system.
django@ASGARD:~$ 

Hence two questions :
⋅ should I place /var/ on another partition or disk ? Or only /var/log ? Maybe it’s not useful to have it on SSD.
⋅ is it safe to delete what’s inside /var/log/journal ?

You can reduce the disk usage using journalctl --vacuum-size=<size>. From the manual page, --vacuum-size “removes the oldest archived journal files until the disk space they use falls below the specified size (specified with the usual “K”, “M”, “G” and “T” suffixes)”. There are more details there you may want to check.

Thanks. See https://discourse.ubuntubudgie.org/t/journalctl-takes-much-storage-has-no-config/3927/1 as this is no longer a snap topic, actually.

Back to topic, why did I encounter those problems to uninstall audacity ?

Can you run snap changes, find the ID of the change where audacity was being removed and failed, then run LC_ALL=C snap change <id> and paste the output?

django@ASGARD:~$ snap changes
Identifiant  État  Descendance          Prêt                 Résumé
100          Done  today at 00:21 CEST  today at 00:23 CEST  Actualiser automatiquement les paquets Snap "core", "chromium"

WARNING: There is 1 new warning. See 'snap warnings'.
django@ASGARD:~$ snap warnings 
last-occurrence:  today at 00:23 CEST
warning: |
  snap "chromium" has bad plugs or slots: system-packages-doc (unknown interface
  "system-packages-doc")
django@ASGARD:~$ 

…sounds like no help here.

And regarding snap, if /var/log is not on the root partition ( like symlinked on another disc ) snap app’s can’t be launched as they require something inside /var/log/tmp

@oSoMoN - should the chromium snap that is now plugging system-packages-doc assumes snapd2.46?

Then no one would get refreshes until 2.46 is released which would be at least a few weeks

This issue was reported as bug #1887795, and I reverted the addition of the system-packages-doc plug until snapd 2.46 is released.

I was hoping snapd would silently ignore the plug, instead of this scary warning.

…sounding like sorcerer’s apprentice ( to me at least ) lol.

So we’ll never know why snap-audacity failed to uninstall.