Problems working with snaps when /var/lib/snapd is a symlink

Due to lack of disk space, I have “/var/lib/snapd” symlinked to a directory on a partition with more room (Ubuntu 22.04). Unfortunately installing software that depends on snap does not work:

$ sudo snap remove chromium
chromium removed
$ sudo snap install chromium
2025-03-02T18:31:37Z INFO cannot update "cups", will not have required content "foo": cannot find installed
snap "cups" at revision 1067: missing file /snap/cups/1067/meta/snap.yaml
2025-03-02T18:31:37Z INFO cannot update "gnome-42-2204", will not have required content "gnome-42-2204": cannot
find installed snap "gnome-42-2204" at revision 202: missing file /snap/gnome-42-2204/202/meta/snap.yaml
error: cannot perform the following tasks:
- Run configure hook of "chromium" snap if present (run hook "configure": cannot open /var/lib/snapd/cgroup/snap.chromium.device: Permission denied)
$ chromium-browser 

Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:

snap install chromium

$ sudo snap remove chromium
snap "chromium" is not installed

At the sudo snap install chromium stage in the above it does spend considerable time downloading something. Nothing on a filesystem level ought to prevent the creation of /var/lib/snapd/cgroup/snap.chromium.device.

What can I do to investigate and resolve this issue?

Yeah, don’t do that, apparmor will not allow symlinking, just use a bind mount instead and it will work fine…

See the answers in this post for more details:

1 Like

Thanks. Given that I have to upgrade anyway (due to the end of updates for Ubuntu 22.04 shortly) moving to something the doesn’t rely on snap is probably the easiest route forward.

Huh ? What makes you think 22.04 would not get any updates? It is regularly supported until April 2027 and with pro enabled even until 2032…

Given you simply need to create a small 10 line text file (or alternatively a single line in fstab) I’d personally not go for an upgrade, but up to you indeed…

1 Like

Interesting - I think I’m seeing some variant of this - (unrelated to snap of course but) lsb_release -a says Ubuntu 22.04.5 LTS, yet KDE has a popup saying “This version will stop receiving updates and security fixes in 43 days”.

Oh, you are using a flavor (kubuntu I assume), yeah, they roll on their own schedule… (You wrote “Ubuntu 22.04” above, so I was assuming that…)