What are correct places for:
- Global environment variables meant to affect all users?
- User-specific environment variables?
As recommended on https://help.ubuntu.com/community/EnvironmentVariables:
Avoid the profile and rc files for setting environment variables on Ubuntu. They have caused me more headaches than they are worth.
This is easier said than done however ;)
It is possible that you may run into the same configuration gap that existed for me. See the workaround for encrypted home below.
To add to sagarchalise's answer, I can summarize what the link suggests as appropriate places for settings.
For global settings, system-wide environment variables
From the page :
On my system, the only interesting entry entry in profile.d is
For local or per-user settings
A previous version of the Ubuntu page recommended
which in Lucid and Maverick run
if present, and if the user's shell is bash:
For user environment, there is a confusing array specific to the shell and whether it is considered a "login shell". If the shell is bash:
for zsh, I'm not even going to try to make sense of this.