Ubuntu – ~/.pam_environment doesn’t work since Ubuntu 13.04


I have this line in my ~/.pam_environment:

PATH             DEFAULT=${HOME}/bin:${HOME}/.local/bin:${PATH}

and it worked perfectly well on Ubuntu 12.10, but since I've updated to 13.04 it is completely ignored:

$ echo $PATH

Any ideas why?

Best Answer

  • ~/.pam_environment does not use the normal syntax and you should strictly follow the pam_env.conf syntax.

    Note: Using .pam_environment requires a re-login in order to initialize the variables. Restarting just the terminal is not sufficient to be able to use the variables.

    Source: Session-wide environment variables.

    But I think that the right place to define environment variables such as PATH is ~/.profile or ~/bashrc file (if you put them here you don't need to re-login).

  • Related Question