[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PATH revisited: one PATH to "rule the [Debian] World"



On Sun, Sep 24, 2023 at 09:27 Tom Browder <tom.browder@gmail.com> wrote:
Every time I set up a new host, I have to jump through the hoops trying to

On my main Debian 11 host I have found one formula that works for ssh logins as well as xterm login on a Mate desktop:

I followed most of the formulas on the Debian wiki and suggestions made here plus some experimentation and did this:

1. Set my desired path for users in file /etc/environment

$ cat /etc/environment
PATH=/opt/rakudo/bin:/opt/rakudo/share/perl6/site/bin:/usr/local/bin:/usr/bin

2. I put the identical path in the usr PATH entry in file /etc/profile

3. I copied my .profile file to .xsessionrc.

The result was, regardless of login method, as a normal user I had the same PATH (plus any changes from my ~/.profile file).

4. I modified the root PATH entry in file /etc/profile

When I became root via "sudo -s" I got root's path from /etc/profile. When I became root via "sudo -i" I got the desired PATH change from root's ~/.profile.

So far, I'm a happy camper!

ANOTHER LESSON LEARNED

While I was experimenting with the desktop settings, I stupidly and blindly added an exit line to cut out some 20-year old cruft in the end of the  .profile file and all of a sudden I lost my xterms and couldn't find a way to edit the broken file. Fortunately, I had emacs as one of my menu items: I chose the GUI version and was able to repair the .profile file successfully.

Maybe another editor would have worked, but I'm not going to experiment with that any time soon!

-Tom


Reply to: