0

I declare PATH="/usr/local/anaconda2/bin:/mnt/code/tool:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" in /etc/environment.

But when I re-login,

$ echo $PATH
/home/hwlee/bin:/home/hwlee.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/snap/bin

What did I wrong?

5
  • 1
    What is the content of your /etc/environment?
    – Soren A
    Dec 5, 2017 at 9:39
  • PATH="/usr/local/anaconda2/bin:/mnt/code/tool:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
    – Hans Lee
    Dec 6, 2017 at 7:05
  • Which version of Ubuntu? Are you manually setting PATH in ~/.profile, ~/.bashrc or somewhere like that?
    – muru
    Dec 6, 2017 at 14:38
  • Ubuntu 16.04.1 LTS. Nope I have to use only /etc/environment
    – Hans Lee
    Dec 6, 2017 at 15:30
  • @HansLee Please edit with the output of running ls -l /etc/profile.d, and also add the complete text of each of these files that exist (mentioning which is which) and say which ones don't exist: ~/.pam_environment, ~/.profile, ~/.bash_profile, ~/.bash_login, ~/.bashrc, /etc/profile, /etc/bash.bashrc, and--unless the line you showed was the whole thing, in which case please clarify that--/etc/environment. (One way to view the contents of a text file is with the cat command; for example, cat ~/.pam_environment outputs the contents of ~/.pam_environment.) Thanks! Dec 6, 2017 at 15:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.