1

My /var is full because the old snaps are not being deleted.

  1. As a stopgap, can I just manually delete all but the two most recent snaps?
  2. How can I make the old snaps be automatically deleted like I think they are supposed to be?
    (note that when I copy/pasted the output from the terminal commands, it ran everything together, I had to add extra carriage returns to separate the lines)
careyschug@OptiPlex-7050:~$ snap list --all
Name                        Version                     Rev    Tracking         Publisher        Notes
audacity                    3.1.3                       1051   latest/stable    lucyllewy✪       -
bare                        1.0                         5      latest/stable    canonical✓       base
blue-recorder               0+git.77ab1d6               126    latest/stable    xlmnxp           -
brave                       1.61.116                    331    latest/stable    brave✓           disabled
brave                       1.62.153                    335    latest/stable    brave✓           -
chromium                    120.0.6099.216              2729   latest/stable    canonical✓       disabled
chromium                    121.0.6167.85               2738   latest/stable    canonical✓       -
chromium-ffmpeg             0.1                         34     latest/stable    canonical✓       disabled
carey@OptiPlex-7050:/var/lib/snapd/snaps$ ls -al
total 12390516
drwxr-xr-x  3 root root      4096 Feb  3 21:20 .
drwxr-xr-x 23 root root      4096 Feb  3 21:24 ..
-rw-------  2 root root 261177344 Dec  2  2022 audacity_1051.snap
-rw-------  1 root root      4096 Aug  9  2022 bare_5.snap
-rw-------  2 root root 152416256 Dec  2  2022 blue-recorder_126.snap
-rw-------  1 root root 161738752 May 17  2023 brave_234.snap
-rw-------  1 root root 161374208 Jun 14  2023 brave_242.snap
-rw-------  1 root root 163106816 Jul  7  2023 brave_246.snap
-rw-------  1 root root 164630528 Jul 21  2023 brave_250.snap
-rw-------  1 root root 164634624 Jul 26  2023 brave_252.snap
-rw-------  1 root root 162439168 Aug  4  2023 brave_256.snap
-rw-------  1 root root 165072896 Aug 24 07:11 brave_262.snap
-rw-------  1 root root 165101568 Sep 12 10:12 brave_272.snap
-rw-------  1 root root 166170624 Sep 20 11:21 brave_279.snap
-rw-------  1 root root 166178816 Sep 22 10:32 brave_281.snap
-rw-------  1 root root 166842368 Nov  2 06:05 brave_297.snap
-rw-------  1 root root 167243776 Nov  8 03:05 brave_299.snap
-rw-------  1 root root 167202816 Dec  6 14:18 brave_318.snap
-rw-------  1 root root 170098688 Dec  7 10:23 brave_321.snap
-rw-------  1 root root 170168320 Dec 21 07:16 brave_325.snap
-rw-------  1 root root 170192896 Jan 10 11:27 brave_329.snap
-rw-------  1 root root 170188800 Jan 14 03:51 brave_331.snap
-rw-------  1 root root 170192896 Jan 25 09:11 brave_333.snap
-rw-------  1 root root 173035520 Jan 31 07:25 brave_335.snap
-rw-------  1 root root 173109248 Feb  3 21:20 brave_338.snap
-rw-------  1 root root 159129600 Sep 19 09:51 chromium_2623.snap
-rw-------  1 root root 165093376 Nov  9 00:05 chromium_2680.snap
-rw-------  1 root root 165117952 Nov 16 01:15 chromium_2686.snap
-rw-------  1 root root 165117952 Dec  7 13:18 chromium_2704.snap
-rw-------  1 root root 166608896 Jan  4 01:26 chromium_2719.snap
zx485
  • 2,426
  • Please edit your post and add the output of the following command executed in a terminal to your post: sudo snap get system refresh.retain. – noisefloor Feb 04 '24 at 08:54
  • careyschug@OptiPlex-7050:~$ sudo snap get system refresh.retain error: snap "core" has no "refresh.retain" configuration option – Carey Tyler Schug Feb 05 '24 at 09:16
  • Note that my OP included "snap list --all" and THAT only shows two snaps per package, but the ls of all files shows way more than two. And looking more closely, ONLY chromium and Brave (which is a derivative of chromium) have excess snap images that do not show up in the snap list, so maybe it is a chromium problem? – Carey Tyler Schug Feb 05 '24 at 09:21
  • My OP copy/past got cut off, there were at least 3 more snap packages for chromium, including the package numbers shown in the snap list, Note that for brave, the last two package files have numbers corresponding to what the snap list displays. – Carey Tyler Schug Feb 05 '24 at 09:24
  • If you run the command sudo snap remove brave --revision=234 from the terminal, does it complete successfully or do any errors occur? If so, which errors? – noisefloor Feb 05 '24 at 09:43
  • @noisefloor I'm here from my own duplicate question as I have the identical problem, and when I try to remove a version that is not listed with snap list yet exists in the filesystem - it returns revision 127 of snap "code" is not installed – zerkms Feb 07 '24 at 03:15
  • Exactly as I was confident it would do: careyschug@OptiPlex-7050:~$ sudo snap remove brave --revision=234 [sudo] password for careyschug: revision 234 of snap "brave" is not installed – Carey Tyler Schug Feb 08 '24 at 05:21

1 Answers1

1

To remove Snaps using a GUI application, install Stacer from Ubuntu Software.

There is an uninstaller option in the app which will list all your Snap Packages and you can individually select the ones you wish to remove after which you will be asked to input your password for authentication and the packages selected will be removed.

The application has many other features too which I find extremely useful and simple to use.

enter image description here

graham
  • 10,436
  • My OP gave the output from snap list --all which shows that SNAP thinks there only 2 versions. the files for more versions are present but not in the database of SNAPs. When I looked more closely, ONLY chromium and brave (which is a derivative of chromium) have undelete files, so good chance it is a chromium issue that got inherited into brave. – Carey Tyler Schug Feb 05 '24 at 09:13
  • @CareyTylerSchug totally not chromium specific: I have the same issue with vscode, phpstorm, and skype. – zerkms Feb 07 '24 at 03:16
  • so where do I go to file a bug report so it might be fixed? note in the section above, somebody else has the problem too. – Carey Tyler Schug Feb 08 '24 at 05:25
  • @CareyTylerSchug a quick search would have pointed you to where to report issues with Snaps – graham Feb 08 '24 at 05:59