SNAP packages / broken symlinks

Hi,

I’m using Ubuntu 22.04 LTS and I see that my ~/snap/ packages directories contains a lot of broken symlinks from multiple packages. (firefox,thunderbird,gimp,remmina,libreoffice,snapd,snap-store, …)

The broken symlinks are mostly in the ~/snap/[package]/common/.cache directories and in “immodules” and “gio-modules” sub-directories.

The issue is that the symlinks in these directories are pointing to their /snap/[package]/ path but to a “gnome-platform” directory which does not exist.

Here are some examples:

./snap/libreoffice/common/.cache/gio-modules/libgiognutls.so -> /snap/libreoffice/285/gnome-platform/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so

./snap/gimp/common/.cache/gio-modules/libgiognutls.so -> /snap/gimp/393/data-dir/gnome-platform/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so

./snap/firefox/common/.cache/immodules/im-broadway.so -> /snap/firefox/2908/gnome-platform/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-broadway.so

./snap/snapd-desktop-integration/common/.cache/gio-modules/libgioenvironmentproxy.so -> /snap/snapd-desktop-integration/83/gnome-platform/usr/lib/x86_64-linux-gnu/gio/modules/libgioenvironmentproxy.so

Basically the “gnome-platform/” in the path should be removed for the symlinks to be correct.

Other packages do omit “gnome-platform/” and have valid symlinks for “gio-modules” and “immodules”.

You can find all these broken symlinks by issuing the following command: “find ~/snap -xtype l -ls”

So my questions are, is this normal ? is there a bad side effect when running these snap packages ?

Regards.

There probably will be a gnome-platform directory in the context of the current snap; try:

snap run --shell firefox
ls $SNAP
exit

Chances are, that symlink from the perspective of the snapped app is valid. It’ll only be when you’re looking at it from the host it looks dangling.

Yes, you are right, this is the case for every package, thank you for the explanation :slight_smile:

When I ran “snap run -shell firefox” the first time I got these errors, but not the second time I ran it:

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/gimp/2.0/help /usr/share/gimp/2.0/help none bind,ro 0 0): cannot open directory “/var/lib/snapd”: permission denied

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/gtk-doc /usr/share/gtk-doc none bind,ro 0 0): cannot open directory “/var/lib/snapd”: permission denied

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/libreoffice/help /usr/share/libreoffice/help none bind,ro 0 0): cannot open directory “/var/lib/snapd”: permission denied

update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/usr/share/xubuntu-docs /usr/share/xubuntu-docs none bind,ro 0 0): cannot open directory “/var/lib/snapd”: permission denied

Do you know why ?