Install snapcraft snap on Pi stretch

Trying to install the snapcraft snap on a Raspbery Pi running Debian Stretch

sudo snap install --candidate --classic snapcraft

seems to succeed returning

snapcraft (candidate) 2.33 from 'canonical' installed

but then I get

$ snapcraft
-bash: snapcraft: command not found

What magic am I missing ?

Probably the PATH. Is /snap/bin in it? Does it get added if you logout/in?

If not, you can invoke snapcraft from /snap/bin/snapcraft as a temporary workaround.

1 Like

did you actually install snapd right before this ?

in ubuntu we ship a /etc/profile.d snippet to extend the PATH to include /snap/bin, to make such a snippet take effect you have to re-login once …

you can call snapcraft with the full /snap/bin path though …

1 Like

is this your first snap that you’ve installed? if so then you need to log-out and back-in to pick up the updated PATH pointing to /snap/bin. As @popey says, you can also run /snap/bin/snapcraft or snap run snapcraft in the meantime.

2 Likes

oops - ok - now getting

OSError: Could not locate nacl lib, searched for libsodium.so, libsodium.so.13, libsodium.so.10, libsodium.so.5, libsodium.so.4,  and tweetnacl.so

OK - adding

sudo apt install libsodium-dev

seems to make it happy… onwards

Thats sounds like a bug with the snapcraft snap … it should ship all necessary dependencies by default (and have LD_LIBRARY_PATH properly adjusted to find them in the snap)

@sergiusens@kyrofa ?

Huh, indeed, that sounds like a bug! Wonder how it’s working on Ubuntu.

Looks like we stage it. Perhaps we’re not properly accounting for the arch-specific path.

1 Like

Hmm, the above error message seems to actually look for fairly old versions, i see
/usr/lib/x86_64-linux-gnu/libsodium.so.18
on my system while the newest in the OSerror is 13

indeed - the version I manually apt installed was

/usr/lib/arm-linux-gnueabihf/libsodium.so.18

ctypes are patched to look for the libraries in the correct locations. I am guessing this is just something that needs a twist of knobs for armhf