SparkyLinux Forums

Installation & Upgrade => System upgrading => Topic started by: seppalta on April 23, 2018, 04:20:13 PM

Title: Frozen PATH (solved)
Post by: seppalta on April 23, 2018, 04:20:13 PM
Recently installed and dist-upgraded a Sparky Openbox to kernel 4.15.0-2.  My PATHs:
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
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?
Title: Re: Frozen PATH
Post by: pavroo on April 23, 2018, 04:38:04 PM
I used to put my paths to:
~/.profile
and after re-login works ok.
Title: Re: Frozen PATH
Post by: seppalta 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?
Title: Re: Frozen PATH
Post by: pavroo on April 23, 2018, 09:32:26 PM
# 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:
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:
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.
Title: Re: Frozen PATH
Post by: seppalta on April 26, 2018, 05:02:08 AM
Thanks, Pavroo, but nothing seems to work.  I'm afraid some systems have their own minds. 

Title: Re: Frozen PATH (solved)
Post by: seppalta 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.