/var/lib/snapd/snaps/ is not cleaned up
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
I'm running ubuntu 20.04 and recently discovered that `/var/lib/
For instance skype:
```
# ls -la /var/lib/
-rw------- 1 root root 146771968 Apr 19 2023 /var/lib/
-rw------- 1 root root 146771968 Apr 24 2023 /var/lib/
-rw------- 1 root root 147140608 Apr 25 2023 /var/lib/
-rw------- 1 root root 147746816 May 24 2023 /var/lib/
-rw------- 1 root root 148983808 Jun 16 2023 /var/lib/
-rw------- 1 root root 189390848 Aug 17 12:56 /var/lib/
-rw------- 1 root root 183963648 Oct 2 20:54 /var/lib/
-rw------- 1 root root 183963648 Oct 6 22:56 /var/lib/
-rw------- 1 root root 184414208 Nov 1 20:45 /var/lib/
-rw------- 1 root root 184659968 Dec 5 23:00 /var/lib/
-rw------- 1 root root 185167872 Dec 8 18:47 /var/lib/
-rw------- 1 root root 185163776 Dec 11 22:19 /var/lib/
-rw------- 1 root root 185167872 Dec 14 11:36 /var/lib/
-rw------- 1 root root 185294848 Jan 23 22:58 /var/lib/
-rw------- 1 root root 187752448 Jan 31 19:28 /var/lib/
-rw------- 1 root root 187752448 Feb 5 16:23 /var/lib/
```
yet only 2 versions are actually installed:
```
# snap list --all|grep -i skype
skype 8.111.0.607 323 latest/stable skype** -
skype 8.110.0.218 320 latest/stable skype** disabled
```
But even here there is some oddity - see that the installed are 320 and 323, but also 325 and 326 are in the snaps :shrug:
I wouldn't bother otherwise, but currently `/var/lib/
This machine is rebooted regularly (usually every kernel release, so at least once or twice a month), so it definitely is not that some cleanup routine that didn't have chance to trigger the actual cleanup.
Am I doing something wrong and should I somehow clean it up manually? Or is it some well known bug, which I honestly couldn't find.
PS: this question is the exact copy from my original post at [askubuntu.com](https:/
Changed in snapd: | |
status: | New → Fix Committed |
milestone: | none → 2.62 |
This affects me too. Mostly with one snap:
``` snapd/snaps/ miriway* snapd/snaps/ miriway_ 2444.snap snapd/snaps/ miriway_ 2627.snap snapd/snaps/ miriway_ 2638.snap snapd/snaps/ miriway_ 2699.snap snapd/snaps/ miriway_ 2759.snap snapd/snaps/ miriway_ 2770.snap snapd/snaps/ miriway_ 2794.snap snapd/snaps/ miriway_ 2824.snap snapd/snaps/ miriway_ 2839.snap snapd/snaps/ miriway_ 2859.snap snapd/snaps/ miriway_ 2868.snap snapd/snaps/ miriway_ 2895.snap snapd/snaps/ miriway_ 2910.snap snapd/snaps/ miriway_ 2922.snap snapd/snaps/ miriway_ 2955.snap snapd/snaps/ miriway_ 2981.snap
$ snap list --all miriway
Name Version Rev Tracking Publisher Notes
miriway 109-mir2.16.2 2794 latest/beta alangriffiths✪ disabled,classic
miriway 113-mir2.16.3 2981 latest/beta alangriffiths✪ classic
$ ls -1 /var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
```
This snap is unusual as I run for long periods (usually between reboots - days to weeks), but has updates frequently (I often have it tracking the `main` branch of the Mir, which updates several times a day).
Hence, I suspect that versions are downloaded pending the snap closing that are unused but not deleted. Either because another version comes along in the meantime, or because I refresh to another channel, or I install a local build.
Empirically, cleaning up manually doesn't seem to cause problems:
``` snapd/snaps/ miriway* | grep -v -e 2794 -e 2981 | xargs sudo rm
$ ls -1 /var/lib/
```