Ubuntu: How to change permanently the PATH with Ubuntu 12.04 LTS?



Question:

To add :/usr/local/go/bin to the PATH with Ubuntu 10.04 LTS (Lucid) and permanently change the PATH, I just edited the files /etc/environment and /etc/login.defs.

And these modifications were OK both for my current user account and my root account.

i.e. echo $PATH returned the modified PATH for my user account as well as for the root account when using sudo -i or su.

However, this doesn't work anymore with Ubuntu 12.04 LTS when doing the same modifications if using sudo -i!

Meanwhile, this works when using su!

What should I explicitly modify to get permanently that same behavior with Precise Pangolin when using sudo -i?


Solution:1

sudo -i is supposed to be a "safe" sudo. That means that it ignores any changes to path such that it is restricted to managed programs.

Use sudo -s instead if you want to load /etc/environment instead of using sudo -i.

See also:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »