Advertising

Author Topic: Frozen PATH (solved)  (Read 460 times)

Offline seppalta

  • Full Member
  • ***
  • Posts: 169
Frozen PATH (solved)
« on: April 23, 2018, 04:20:13 pm »
Recently installed and dist-upgraded a Sparky Openbox to kernel 4.15.0-2.  My PATHs:
Code: [Select]
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
First question, why no sbins?
I've put various command versions of
Code: [Select]
PATH="$PATH:/opt/menu";export PATH
separately into /etc/profile, or /etc/environment, or ~/.bashrc.  I also tried just adding /opt/menu to the list in /etc/environment.  Nothing worked.  All of these approaches got me new paths on the same system in the past!
Second question, what can I do to get additional paths on PATH?  Is this latest kernel messing with things?
« Last Edit: May 09, 2018, 11:31:26 pm by seppalta »

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1866
    • SparkyLinux
Re: Frozen PATH
« Reply #1 on: April 23, 2018, 04:38:04 pm »
I used to put my paths to:
Code: [Select]
~/.profileand after re-login works ok.
Nothing is easy as it looks.
Danielle Steel

Offline seppalta

  • Full Member
  • ***
  • Posts: 169
Re: Frozen PATH
« Reply #2 on: April 23, 2018, 08:24:08 pm »
Yes, I tried .profile as well.
Could you give me exactly, down to the last comma, what you would enter in .profile, or where-ever, to get /opt/menu on the path?

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1866
    • SparkyLinux
Re: Frozen PATH
« Reply #3 on: April 23, 2018, 09:32:26 pm »
Code: [Select]
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ]; then
    PATH="$HOME/bin:$PATH"
fi
so, in my way it should be:
Code: [Select]
if [ -d "/opt/menu" ]; then
    PATH="/opt/menu:$PATH"
fi
But the ~/.profile points to ~/.bashrc too, so I put varibles to bashrc too (when building some apps), instead of profile, such as:
Code: [Select]
XDG_DATA_DIRS=/usr/local/share/:/usr/share/
export XDG_DATA_DIRS
XDG_DATA_HOME=/usr/local/share/
export XDG_DATA_HOME
it worked too.
Nothing is easy as it looks.
Danielle Steel

Offline seppalta

  • Full Member
  • ***
  • Posts: 169
Re: Frozen PATH
« Reply #4 on: April 26, 2018, 05:02:08 am »
Thanks, Pavroo, but nothing seems to work.  I'm afraid some systems have their own minds. 

« Last Edit: May 09, 2018, 11:54:58 pm by seppalta »

Offline seppalta

  • Full Member
  • ***
  • Posts: 169
Re: Frozen PATH (solved)
« Reply #5 on: May 09, 2018, 11:54:30 pm »
After several failed attempts involving modifications to these files: /etc/environment; /etc/profile;  ~/.bashrc; ~/.bash_profile; ~/.bash_login;  ~/.profile; /.profiles.d; and possibly one or two others, I reset everything back to how it was originally.  Then I added the two new directories that I wanted on the path to the list in /etc/environment, which is what I did originally, and it hadn't worked.  This time it worked!?!  My guess is that I must have made a minor technical error like a misspelled word, wrong punctuation, or something that corrupted the code.
« Last Edit: May 10, 2018, 03:13:51 am by seppalta »