Ubuntu – Ubuntu has a different PATH when accessed over XRDP session

command lineguipaths

Noob here: I have a problem, when i access my server via SSH, the $PATH is correct

root@ks391320:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

But when i open my server via XRDP session and go to the terminal it shows an incorrect PATH:

root@ks391320:~# echo $PATH
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin

Screenshot of both: Screenshot

And this creates an issue because when I try to install something using the "Package Installer" it shows this error (among others)

dpkg: warning: 'ldconfig' not found in PATH

Best Answer

For Ubuntu-18.04, edit /etc/pam.d/xrdp-sesman and enter the following lines at beginning:

session       required   pam_env.so readenv=1 envfile=/etc/environment
session       required   pam_env.so readenv=1 envfile=/etc/default/locale
Related Question