Debian $PATH variable change Debian $PATH variable change unix unix

Debian $PATH variable change


This is set in the /etc/login.defs on debian 6.0 .

These are the lines you have to edit:

# *REQUIRED*  The default PATH settings, for superuser and normal users.## (they are minimal, add the rest in the shell startup files)ENV_SUPATH      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

EDIT:

I forgot to put where I found the solution: https://serverfault.com/questions/166383/how-set-path-for-all-users-in-debian


Modify /etc/environment to include a line like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"


If you are using a graphical display manager / GUI (a.k.a not just a shell or terminal) changing the /etc/profile, ~/.bashrc or other file will not change the PATH variable.

In this case you have to create the file: ~/.xsessionrc file and add something like this:

export  PATH="$PATH:/sbin"

(depending on the path you want to add)

For more info: https://wiki.debian.org/EnvironmentVariables

NOTE for Debian 10, check out this solution first if you get command not found:

su - root instead of su root

https://unix.stackexchange.com/questions/482569/debian-10-buster-update-grub-command-not-found