I traced down the issue to the /etc/profile. This file is only loaded when typing "sudo su -", which in turn calls the /etc/profile.d/apps-bin-path.sh script where the snapd fix to keep the path is placed.
I have no clue where the true fix to enable it would need to be inserted. Perhaps modifying the /etc/pam.d/su config file or something.
Wow! This puzzled me for a while.
On a fresh Ubuntu Server 18.04 install. snap up to date. It turns out that in my case, the issue was caused by a change in Debian's default behavior of the su command. /unix.stackexch ange.com/ questions/ 460478/ debian- su-and- su-path- differences
https:/
Since package installs require elevated privileges, it is useful to just type "sudo su" and install all the required packages. See for yourself:
user@ubuntu- hyperv- vm:~$ sudo su hyperv- vm:/home/ user# echo $PATH && exit sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin:/usr/ games:/ usr/local/ games bin:/usr/ bin:/bin: /usr/local/ games:/ usr/games
root@ubuntu-
/usr/local/
/usr/local/
exit hyperv- vm:~$ sudo su - hyperv- vm:~# echo $PATH && exit sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin:/usr/ games:/ usr/local/ games:/ snap/bin
user@ubuntu-
root@ubuntu-
/usr/local/
logout
I traced down the issue to the /etc/profile. This file is only loaded when typing "sudo su -", which in turn calls the /etc/profile. d/apps- bin-path. sh script where the snapd fix to keep the path is placed.
I have no clue where the true fix to enable it would need to be inserted. Perhaps modifying the /etc/pam.d/su config file or something.