[SOLVED] Edit search path in LMDE3

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
rowihei
Level 1
Level 1
Posts: 3
Joined: Tue Nov 05, 2019 12:36 pm

[SOLVED] Edit search path in LMDE3

Post by rowihei » Wed Nov 06, 2019 6:13 am

Hallo,
after 1000 tries I found no solution for this:
Many years I used Lubuntu ... but now I tested LMDE 3.
In Lubuntu the path could be customized in file /home/user/.profile
But this file is not relevant for LMDE3.
I only want to insert $HOME/.bin in system variable PATH
Perhaps I should mention sth.:
I installed LXQT-desktop and purged Cinnamon-desktop

Thanks for each tip ...
Last edited by rowihei on Sat Nov 09, 2019 5:03 am, edited 2 times in total.

axisofevil
Level 3
Level 3
Posts: 111
Joined: Mon Nov 14, 2011 12:22 pm

Re: Edit search path in LMDE3

Post by axisofevil » Thu Nov 07, 2019 3:05 pm

It shouldn't be necessary for LMDE - assuming that you mean "$HOME/bin" and not "$HOME/.bin"
If you look in ~/.profile you should see the following:-
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

rowihei
Level 1
Level 1
Posts: 3
Joined: Tue Nov 05, 2019 12:36 pm

Re: Edit search path in LMDE3

Post by rowihei » Fri Nov 08, 2019 6:48 am

Hallo,
Thank you for your fast answer
Of course I mean $HOME/.bin - I like this.
Under Lubuntu I only edit ~/.profile in this way, but under LMDE3 it's feeling, like system doesn't read this file.
That's why I think there must be another config file, to insert something in $PATH

Thats my file ~/.profile:
tux@lmde3:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.bin" ] ; then
PATH="$HOME/.bin:$PATH"
fi

And here the result:
tux@lmde3:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
tux@lmde3:~$

Where is in LMDE3 the config-file for users private PATH ?

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Edit search path in LMDE3

Post by Flemur » Fri Nov 08, 2019 9:48 am

Stick the $PATH at the end of ~/.bashrc

Code: Select all

PATH=$PATH:/home/<username>/bin
or in your case,

Code: Select all

PATH=$PATH:/home/<username>/.bin
(replace <username> with your real username)
Your local bin directory should be LAST in the path, as above, NOT first as the default .profile tries to do.

Then after you login do
echo $PATH
to make sure it's correct.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

rowihei
Level 1
Level 1
Posts: 3
Joined: Tue Nov 05, 2019 12:36 pm

[SOLVED] Re: Edit search path in LMDE3

Post by rowihei » Sat Nov 09, 2019 4:58 am

Hallo Flemur,

that's it - now the $HOME/.bin is inserted in the search path. - Thank you !
But why should this not be on first position in $PATH ?

Bye

Post Reply

Return to “Software & Applications”