Search code examples
unixpathenvironment-variablesdebian

Debian $PATH variable change


How can I change the $PATH variable in Debian? I tried to change /etc/profile but this affected only normal users (and yes, I added path to BOTH user's and root's paths).

After that I tried to edit /root/.profile and then /root/.bashrc also ...

Neither worked. Do you know where could be problem?


Solution

  • 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:/bin
    ENV_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