-bash: hello-world: command not found

My first try with snap and it does not seem to work.
On Raspberry Pi OS, installed snap via software add.
I ran
sudo snap install hello-world
seemed OK, I see -
pi@pi-test:~ $ snap info hello-world
name: hello-world
summary: The ‘hello-world’ of snaps
publisher: Canonical✓
store-url: https://snapcraft.io/hello-world
contact: snaps@canonical.com
license: unset
description: |
This is a simple hello world example.
commands:

  • hello-world.env
  • hello-world.evil
  • hello-world
  • hello-world.sh
    snap-id: buPKUD3TKqCOgLEjjHx5kSiCpIs5cMuQ
    tracking: latest/stable
    refresh-date: today at 15:36 GMT
    channels:
    latest/stable: 6.4 2019-04-17 (29) 20kB -
    latest/candidate: 6.4 2019-04-17 (29) 20kB -
    latest/beta: 6.4 2019-04-17 (29) 20kB -
    latest/edge: 6.4 2019-04-17 (29) 20kB -
    installed: 6.4 (29) 20kB -
    pi@pi-test:~ $

but -
pi@pi-test:~ $ hello-world
-bash: hello-world: command not found
pi@pi-test:~ $

What have I missed?

snapd adds /snap/bin to your PATH when installing the snapd package … changes to PATH will only get recognized by your system after you logged out and back in again … try that and hello-world should then be found.

Tried that and it seems to be working now but with an error. This is what I see -
pi@pi-test:~ $ hello-world
ERROR: ld.so: object ‘/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so’ from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Hello World!
pi@pi-test:~ $

ths is caused by a (really awful) raspberrypiOS hack, forcing every executed binary to preload the armmem lib to intercept certain default system calls (which is simply not allowed by the snap security environment, you could effectively inject anything into a binary that way) … it does no harm to not preload that lib, you can either ignore the messages or comment out the line in /etc/ld.so.preload (and reboot) if it really bothers you

1 Like

Thanks for the feedback. I have some other issues but I will post a new topic for that as this is really solved.