2

I followed the installation guide from snapcraft.io. My system cannot find the hello-world application:

$ sudo snap install hello-world
[sudo] password for gauthier: 
hello-world 6.4 from Canonical✓ installed
$ hello-world
bash: hello-world: command not found

How do I fix this?

Debian 10, but I guess the process is the same as Ubuntu.

Gauthier
  • 2,631
  • 3
  • 27
  • 38
  • Does this answer your question? [Snap (snapd) hello-world example not working (path not found?)](https://askubuntu.com/questions/917233/snap-snapd-hello-world-example-not-working-path-not-found) – Kulfy Nov 23 '20 at 12:19
  • @Kulfy it does, I didn't think to search with hello world specifically, since I had the problem with another application first. Silly of me. I still don't get why installing snap with apt couldn't make the update to PATH. – Gauthier Nov 23 '20 at 12:21
  • I assume APT is reluctant to modify `/etc/environment`, `*profile*` or the shell specific files. :) – Kulfy Nov 23 '20 at 12:24
  • Moreover, if that question does answer your question, you may consider closing your question as a duplicate of that question. – Kulfy Nov 23 '20 at 12:25
  • @Kulfy Duplicates can be good? https://stackoverflow.blog/2010/11/16/dr-strangedupe-or-how-i-learned-to-stop-worrying-and-love-duplication/ – Gauthier Nov 23 '20 at 12:36
  • Absolutely. I never suggested/asked to delete the Q&A. The main purpose of closing questions as duplicate is to link them. – Kulfy Nov 23 '20 at 12:41

1 Answers1

4

Apparently, installing snap from apt does not add the correct path to /etc/environment, or PATH.

The snap applications are in /snap/bin/, so there is the string to somehow add to your PATH.

I feel that this should be automated, or at least pointed out to the user upon installation of snap. (Yes, I rebooted with no success.)

Gauthier
  • 2,631
  • 3
  • 27
  • 38
  • I just checked on my system and `/snap/bin` is in `PATH`. However, the snap application in question may not add it's executable to `/snap/bin`. I know little about snaps, but I guess it's up to application to do that. – raj Nov 23 '20 at 11:15
  • It's in /snap/bin – Gauthier Nov 23 '20 at 11:16
  • @raj **I just checked on my system and `/snap/bin` is in `PATH`**: That's because you may be using Ubuntu but Gauthier is using Debian. And in Ubuntu Desktop, Snap is installed by default. **the snap application in question may not add it's executable to `/snap/bin`**: Well that would defy the whole purpose of package managers and "automated" installation. Usually binaries or symbolic link to binaries are in `*bin`. – Kulfy Nov 23 '20 at 12:17