/etc/environment and /etc/profile.d/* ignored for the root user
10,711
You will need to get into a real root login shell:
sudo su -
Related videos on Youtube
Comments
-
covariance over 1 year
How do I set global environment variables in Ubuntu, in such a way, that they would apply also to
root
user?Setting
PATH
orJAVA_HOME
in/etc/environment
or in/etc/profile.d/my_settings.sh
both works for usual user, but not forroot
.I'm logging in as root using
sudo bash
orsudo zsh
.NOTE: using Ubuntu 10.04.
-
covariance over 12 yearsI get an error: "Sorry, user [...] is not allowed to execute '/bin/su' as root on [...]"
-
enzotib over 12 yearsHave you used
sudo
beforesu
? -
Doktor J almost 8 years@AleksandrDubinsky
sudo su
without 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