Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by Florian Diesch, jokerdino Dec 3 '13 at 15:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer 1

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

sudo su -
share|improve this answer
    
I get an error: "Sorry, user [...] is not allowed to execute '/bin/su' as root on [...]" –  Ivivi Vavava Sep 26 '11 at 10:37
    
Have you used sudo before su? –  enzotib Sep 26 '11 at 16:47
1  
sudo -i also works. –  elmicha Sep 26 '11 at 17:39
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.