I don't have any alias in the CLI

I installed some snap packages to test how snap work in general:

snap list                      
Name         Version    Rev   Developer       Notes
atom         1.22.0     56    snapcrafters    classic
core         16-2.29.3  3440  canonical       core
keepassxc    2.2.2      26    keepassxreboot  -
ubuntu-make  master     116   didrocks        classic

While the packages work (I have the desktop files and I can launch them) on the CLI there is no alias to launch them, both with zsh and bash:

~                                                                              
▶ atom . 
zsh: correct 'atom' to 'atobm' [nyae]? n
zsh: command not found: atom

~                                                                             ⍉
▶ bash
rpadovani@artemis:~$ atom .
No command 'atom' found, did you mean:
 Command 'atom4' from package 'atom4' (universe)
 Command 'atobm' from package 'x11-apps' (main)
 Command 'atoms' from package 'horae' (multiverse)
 Command 'atrm' from package 'at' (main)
 Command 'atop' from package 'atop' (universe)
atom: command not found

What am I missing?

Can I please see the output of snap version? Mostly looking to see what OS you’re on.

▶ snap version
snap    2.29.3
snapd   2.29.3
series  16
ubuntu  16.04
kernel  4.10.0-38-generic

Well that’s interesting. /snap/bin should be in your PATH on Xenial. Can you verify that it’s not?

Good one, thanks.

Indeed it wasn’t neither in the bash or in the zsh one.

I added it manually and it works.

it happened to me on two different computers, so maybe a bug?

~                                                                              
▶ echo $PATH 
/home/rpadovani/Android/Sdk/tools:/home/rpadovani/Android/Sdk/platform-tools:/home/rpadovani/terraform/bin:/home/rpadovani/.anaconda3/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/rpadovani/.rvm/bin

~                                                                              
▶ bash
rpadovani@artemis:~$ echo $PATH
/home/rpadovani/Android/Sdk/tools:/home/rpadovani/Android/Sdk/platform-tools:/home/rpadovani/terraform/bin:/home/rpadovani/.anaconda3/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/rpadovani/.rvm/bin:/home/rpadovani/.rvm/bin

zsh limitations are covered in https://bugs.launchpad.net/bugs/1640514

regarding bash … did you log out and back in again after installling snapd ? the snapd package ships a profile.d snippet that will only take effect on re-login …

Yes, I actually rebooted the PC many times, my first snap installation is quite old

below is the profile.d snippet that is installed on all 16.04 installs by default … (and usually works, else we would have far more complaints) … do you have this ? if yes, but it doesnt work, did you mangle /etc/profile to not source the login defaults from /etc/profile.d in any way ?

ogra@styx:~$ cat /etc/profile.d/apps-bin-path.sh 
#!/bin/sh --this-shebang-is-just-here-to-inform-shellcheck--

# Expand $PATH to include the directory where snappy applications go.
if [ "${PATH#*/snap/bin}" = "${PATH}" ]; then
    export PATH=$PATH:/snap/bin
fi

# desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
# snappy applications' desktop files.
if [ "${XDG_DATA_DIRS#*/snapd/desktop}" = "${XDG_DATA_DIRS}" ]; then
    export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}:/var/lib/snapd/desktop"
fi

Yes, I have that file :thinking:

I have done nothing manually to /etc/profile.d or /etc/profile, maybe something I installed?

If it can help, this is the content of /etc/profile.d:

▶ ls -la /etc/profile.d
total 48
drwxr-xr-x   2 root root  4096 Nov 14 19:55 .
drwxr-xr-x 149 root root 12288 Nov 15 11:13 ..
-rw-r--r--   1 root root    40 Nov 30  2015 appmenu-qt5.sh
-rw-r--r--   1 root root   580 Okt 18 11:04 apps-bin-path.sh
-rw-r--r--   1 root root   663 Mai 18  2016 bash_completion.sh
-rw-r--r--   1 root root  1003 Dez 29  2015 cedilla-portuguese.sh
-rwxr-xr-x   1 root root   301 Feb 20  2013 jdk.csh
-rwxr-xr-x   1 root root   299 Feb 20  2013 jdk.sh
-rw-r--r--   1 root root    89 Jun  7 01:05 nodejs.sh
-rw-r--r--   1 root root  1941 Mär 16  2016 vte-2.91.sh

well, your PATH above has a lot of unusual stuff in it … like bin in hidden dirs i.e:

“/home/rpadovani/.rvm/bin” and “/home/rpadovani/.anaconda3/bin” for example

i doubt these come from any of the files in /etc/profile.d and must come from some manual mangling or some other way of setting PATH, i’d susect there is an issue with that somewhere …

I added them manually in .bashrc:

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

It is strange it happened to me on two different PC, but oh well, in the end I use zshrc and I fixed that :slight_smile:

Thanks for the help!