[SOLVED] Change PATH environment variable for all users.
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to change the PATH variable for all users and for superuser. I have changed the path in /etc/login.defs and in /etc/profile. For the superuser the path is changed, but for normal user not.
I want to change the PATH variable for all users and for superuser. I have changed the path in /etc/login.defs and in /etc/profile. For the superuser the path is changed, but for normal user not.
I am using Debian 8 with the xfce desktop.
What am I missing ???
Not a lot. If the /etc/profile did not do the trick, check the SHELL your users are loading. For BASH users I would load the change into /etc/bash_profile (or, less correctly /etc/bashrc). There are different shell specific profiles for different shells that can override. Make sure you use the pathmunge macro if it is available.
Also, if that fails you, check the ${HOME}/.bash_profile for the user. If they set the path in that it can override everything that came before.
to /etv/environment, it was changed for the superuser as well, which was not what I wanted.
Also: you are right to mention I have to log out and back in, but that is (almost) standard procedure for me when changing settings.
@wpeckham: The files "/etc/bash_profile" and "${HOME}/.bash_profile" are not present on my system. Still, you set me on the right track, so I marked your answer as helpful.
@HMW: Sorry, my bad. Should have been more precise.
What I meant was: I want to change the path for all users into something like "original_PATH_all_users:directory_A", and the path for the superuser into something like "original_PATH_superusers:directory_B:directory_C"
@HMW: Sorry, my bad. Should have been more precise.
What I meant was: I want to change the path for all users into something like "original_PATH_all_users:directory_A", and the path for the superuser into something like "original_PATH_superusers:directory_B:directory_C"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.