What is the difference between running a snap’s app, as defined in the snapcraft.yaml file,
- directly using /snap/bin/mysnap
- manually by first getting a shell with
snap run --shell mysnapand then executing the corresponding command wrapper in $SNAP?
Here is an example to help you understand the situation:
When starting the chromium snap, usually, one would execute /snap/bin/chromium.
To improve my understanding of how snaps function, I opened a shell using
snap run --shell chromium and tried executing
$SNAP/command-chromium.wrapper. Then, however, I got an error, that shared libraries are missing.
/snap/chromium/949/usr/lib/chromium-browser/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
But according to find, these are located in /snap/chromium/949/usr/lib/x86_64-linux-gnu/libX11.so.6
I also tried adding the directory to
LD_LIBRARY_PATH, which did not work either.
My question is the following: Why does chromium find the libraries when beeing called “normally/directly,” but not when beeing inside the snap’s shell?
You can find chromium’s snapcraft.yaml here: https://git.launchpad.net/~chromium-team/chromium-browser/+git/snappy-packaging/tree/snapcraft.yaml