Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

Frozen PATH (solved)

Started by seppalta, April 23, 2018, 04:20:13 PM

Previous topic - Next topic

seppalta

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?

pavroo

I used to put my paths to:
~/.profile
and after re-login works ok.
Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

seppalta

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?

pavroo

# 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.
Nothing is easy as it looks. Danielle Steel
Join #sparkylinux.org at [url="//irc.libera.chat"]irc.libera.chat[/url]

seppalta

#4
Thanks, Pavroo, but nothing seems to work.  I'm afraid some systems have their own minds. 


seppalta

#5
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.

View the most recent posts on the forum