How do I set global environment variables in Ubuntu, in such a way, that they would apply also to root user?
Setting PATH or JAVA_HOME in /etc/environment
or in /etc/profile.d/my_settings.sh
both works for usual user, but not for root.
I'm logging in as root using sudo bash or sudo zsh.
NOTE: using Ubuntu 10.04.
sudobeforesu? – enzotib Sep 26 '11 at 16:47sudo -ialso works. – elmicha Sep 26 '11 at 17:39sudo suwithout the hyphen (not an en-dash or em-dash; that could break things) does not execute /etc/profile, which does not answer OP's question – Doktor J Jul 08 '16 at 17:49