9

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.

Braiam
  • 67,791
  • 32
  • 179
  • 269

1 Answers1

12

You will need to get into a real root login shell:

sudo su -
aquaherd
  • 6,220