I'm currently running Debian 10 Xfce and I would like to update my PATH variable to include /opt/bin
and ~/.local/bin
. As per these - 1 2 answers, I put the following lines in my ~/.profile
file:
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "/opt/bin" ] ; then
PATH="/opt/bin:$PATH"
fi
Now, when I source .profile
from terminal, everything works well and the PATH
is updated. As per this answer, .profile
is source at login, even with a GUI login. So, I expect the PATH
variable to contain my modified locations when I login. Unfortunately, it does not.
Why isn't profile sourced at login?
How do I properly update my PATH
to include the locations I want, if putting them inside .profile
is not gonna work?
.profile
is source on graphical login depends on your login manager. If I remember correctly, GDM and LDM do this, which one are you using? How do you log into your system? – terdon Feb 21 '21 at 15:09