Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Debian 11 set path at login ?
Re: Debian 11 set path at login ?
Now to make even more confusion, I have checked my path
/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Looking in .bashrc I didn't had to add anything. And only configuration for /home/user/bin is in .profile. I will create .local/bin and see if it gets added as well, as is described by in .profile.
/home/mm/.local/bin:/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Okay, logged out and back in, and .local/bin was added to my path as it should. I have tested it in tty and using konsole. I don't know where else would path could possibly be added, no other mention in my home directory. I am using KDE so there is possibility it is adding it somehow where I don't know from.
So far it seems to me that it is working as intended.
/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Looking in .bashrc I didn't had to add anything. And only configuration for /home/user/bin is in .profile. I will create .local/bin and see if it gets added as well, as is described by in .profile.
/home/mm/.local/bin:/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Okay, logged out and back in, and .local/bin was added to my path as it should. I have tested it in tty and using konsole. I don't know where else would path could possibly be added, no other mention in my home directory. I am using KDE so there is possibility it is adding it somehow where I don't know from.
So far it seems to me that it is working as intended.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Debian 11 set path at login ?
Yes it is more confusing. I know that with XFCE and LIGHTDM, $HOME/bin is not getting added to PATH. And furthermore it appears that ~/.profile is not being executed. As Alice said, curiouser and curiouser.mm3100 wrote: ↑2021-08-30 19:38 Now to make even more confusion, I have checked my path
/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Looking in .bashrc I didn't had to add anything. And only configuration for /home/user/bin is in .profile. I will create .local/bin and see if it gets added as well, as is described by in .profile.
/home/mm/.local/bin:/home/mm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Okay, logged out and back in, and .local/bin was added to my path as it should. I have tested it in tty and using konsole. I don't know where else would path could possibly be added, no other mention in my home directory. I am using KDE so there is possibility it is adding it somehow where I don't know from.
So far it seems to me that it is working as intended.
I am not irrational, I'm just quantum probabilistic.
- sunrat
- Administrator
- Posts: 6475
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: Debian 11 set path at login ?
Sorry I can't solve the mystery but just want to add that I also use KDE, and ~/bin/ and ~/local/bin are added to PATH after creating those directories so working as intended. The only entry I find to enable this is in ~/.profilemm3100 wrote: ↑2021-08-30 19:38Okay, logged out and back in, and .local/bin was added to my path as it should. I have tested it in tty and using konsole. I don't know where else would path could possibly be added, no other mention in my home directory. I am using KDE so there is possibility it is adding it somehow where I don't know from.
So far it seems to me that it is working as intended.
So it works for 2 KDE users and not for an Xfce user. Maybe a DE specific issue?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: Debian 11 set path at login ?
One thing you could try is to add a line to each config file you are running like this
obviously you should change bashrc in this command to whichever config file you want to follow, and then simply look at /var/log/syslog to see which files are run when your terminal is opened or script is run.
p.s. remember to remove these lines after your testing unless you want them running permanently.
Code: Select all
logger "running bashrc now"
p.s. remember to remove these lines after your testing unless you want them running permanently.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Debian 11 set path at login ?
Thanks @Dai_trying. I actually did something to check that ~/.profile executes at login. It appears that with my system configuration, XFCE and lightdm, ~/.profile does not execute. Very strange indeed. But maybe I am missing something. I'm not going to worry about it as this was all an effort to help the OP. And the solution I gave him earlier was to add some code at the end of the ~/.bashrc file. I think that takes care of the OP's need, although it doesn't address the issue of ~/.profile not running at login.Dai_trying wrote: ↑2021-08-31 10:41 One thing you could try is to add a line to each config file you are running like thisobviously you should change bashrc in this command to whichever config file you want to follow, and then simply look at /var/log/syslog to see which files are run when your terminal is opened or script is run.Code: Select all
logger "running bashrc now"
p.s. remember to remove these lines after your testing unless you want them running permanently.
I am not irrational, I'm just quantum probabilistic.
Re: Debian 11 set path at login ?
Please read this wiki page: https://wiki.debian.org/EnvironmentVariables
It will explain how PATH is set depending on how you log in.
It will explain how PATH is set depending on how you log in.
- ticojohn
- Posts: 1284
- Joined: 2009-08-29 18:10
- Location: Costa Rica
- Has thanked: 21 times
- Been thanked: 44 times
Re: Debian 11 set path at login ?
I am going to make one last comment on this. Earlier I said I found an article saying that $HOME/.profile and $HOME/.bashrc only execute when the user logs in using an interactive shell. Well I just saw the following code in $HOME/.bashrc in my installation.
Now MAYBE, different desktops and managers do things differently. But at least in the case of XFCE and lightdm it would seem that $HOME/.profile and $HOME/.bashrc are not executed when logging in graphically.
However, I just blew my conclusion out the door. Why? Because adding code at the end of ~/.bashrc to include $HOME/bin in PATH does execute. So obviously ~/.bashrc is getting executed.
Will somebody please slap me up the side of the head and tell me to STFU?
Code: Select all
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
However, I just blew my conclusion out the door. Why? Because adding code at the end of ~/.bashrc to include $HOME/bin in PATH does execute. So obviously ~/.bashrc is getting executed.
Will somebody please slap me up the side of the head and tell me to STFU?
I am not irrational, I'm just quantum probabilistic.
Re: Debian 11 set path at login ?
Thanks for the link to the wiki....
Please read this wiki page: https://wiki.debian.org/EnvironmentVariables
I am using Debian 11, Cinnamon desktop for AMD64.
Since users are provided "/bin/bash" as the default login shell, adding the $HOME/bin to .bashrc seems to be the best work around to me.
The login shell will execute .bash_login, but the PATH established there does not survive the completion of the login process.
Does anyone know where $HOME is first setup for the user ?
Please read this wiki page: https://wiki.debian.org/EnvironmentVariables
I am using Debian 11, Cinnamon desktop for AMD64.
Since users are provided "/bin/bash" as the default login shell, adding the $HOME/bin to .bashrc seems to be the best work around to me.
The login shell will execute .bash_login, but the PATH established there does not survive the completion of the login process.
Does anyone know where $HOME is first setup for the user ?
Re: Debian 11 set path at login ?
Please read the wiki suggested above. It explains that .bashrc and .profile are NOT executed after a graphical login. You should create or edit .xessionrc or .xinitrc to include a reference to .profile like this:
Then make sure .profile contains all your environment variables including:
Code: Select all
if [[ -f ~/.profile ]]; then
. ~/.profile
fi
Code: Select all
export PATH=$PATH:~/bin
Re: Debian 11 set path at login ?
Hi!
Created an account here just to let you know how I solved it on my newly installed Debian 11 (2021 October the 10th).
I'll also add (for future google reference) that this is how you can run flatpak and snap bins from your application runner, or "Run application" (Alt+F2), by adding their respective bin paths to PATH.
Thanks to @Bloom (and everyone else) above for finally pointing out what needs to be done.
1. Create the .xsessionrc file with this content:
2. Add any paths to PATH in your .profile file, and remember to export PATH in the end:
That's it!
The files .bashrc, .profile or .bash_profile, are as mentioned above in the thread not read by a graphical session. If you want to know more about the xsession files, see this link:
https://unix.stackexchange.com/question ... xsessionrc
Created an account here just to let you know how I solved it on my newly installed Debian 11 (2021 October the 10th).
I'll also add (for future google reference) that this is how you can run flatpak and snap bins from your application runner, or "Run application" (Alt+F2), by adding their respective bin paths to PATH.
Thanks to @Bloom (and everyone else) above for finally pointing out what needs to be done.
1. Create the .xsessionrc file with this content:
Code: Select all
#!/bin/sh
. ~/.profile
Code: Select all
# Snap
if [ -d "/snap/bin" ] ; then
PATH="/snap/bin:$PATH"
fi
export PATH=$PATH:~/bin
The files .bashrc, .profile or .bash_profile, are as mentioned above in the thread not read by a graphical session. If you want to know more about the xsession files, see this link:
https://unix.stackexchange.com/question ... xsessionrc
Re: Debian 11 set path at login ?
Hello everybody! Sorry for my bad english. Found a global solution to the problem, adding $ path after logging into X11. I created the following script in /etc/X11/Xsession.d/100basrc_file
After rebooting, and entering X11, the path variable is added automatically.
Code: Select all
#!/bin/bash
. ~/.bashrc
. /etc/profile
Re: Debian 11 set path at login ?
as @ticojohn so empathetically mentioned
(proven that that rule doesn't imply $HOME/.bashrc)
obviously it's possible to source $HOME/.profile without manually adding any .xsessionrc
i'm sure it's a bug in debian lightdm/xfce setup as it's possible to circumvent in xubuntu
i'm not sure what's the difference between the different setups but maybe i'll find out some day
and logging in with xfce and lightdm is obvoiusly not counted as an interactive shellEarlier I said I found an article saying that $HOME/.profile and $HOME/.bashrc only execute when the user logs in using an interactive shell
(proven that that rule doesn't imply $HOME/.bashrc)
how come $HOME/.profile is sourced in xubuntu non-interactive login, using lightdm and xfce and not in debian?However, I just blew my conclusion out the door. Why? Because adding code at the end of ~/.bashrc to include $HOME/bin in PATH does execute. So obviously ~/.bashrc is getting executed.
obviously it's possible to source $HOME/.profile without manually adding any .xsessionrc
i'm sure it's a bug in debian lightdm/xfce setup as it's possible to circumvent in xubuntu
i'm not sure what's the difference between the different setups but maybe i'll find out some day
- fabien
- Forum Helper
- Posts: 668
- Joined: 2019-12-03 12:51
- Location: Anarres (Toulouse, France actually)
- Has thanked: 61 times
- Been thanked: 154 times
Re: Debian 11 set path at login ?
this is how I worked around this:
Code: Select all
$> cat ~/.config/xfce4/xinitrc
#!/usr/bin/env sh
## workaround to enable custom PATH in XFCE with lightdm (which has PATH hardcoded)
## see /usr/bin/startxfce4
## http://xfce.10915.n7.nabble.com/adapted-PATH-not-available-for-GUI-td43586.html
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$HOME/.local/bin:$PATH"
fi
. /etc/xdg/xfce4/xinitrc
-
- Posts: 1
- Joined: 2023-03-15 20:57
Re: Debian 11 set path at login ?
Actually after reviewing the posts, and confirming
a) no .bash_login
b) no .bash_profile
c) yes .profile
d) yes .profile does include the if statement about "$HOME/bin" but in the end...
e) the PATH is equal to "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" , even after i modified the /etc flavours and remove the folder /usr/games, and rebooted.... i still get games in the freaking path!!!!
i agree that the easiest way to do this is to use your .bashrc file and if you want to include directories in the path, use
1) export PATH='/home/user/bin:$PATH' or
2) the code as you suggested.
t
a) no .bash_login
b) no .bash_profile
c) yes .profile
d) yes .profile does include the if statement about "$HOME/bin" but in the end...
e) the PATH is equal to "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" , even after i modified the /etc flavours and remove the folder /usr/games, and rebooted.... i still get games in the freaking path!!!!
i agree that the easiest way to do this is to use your .bashrc file and if you want to include directories in the path, use
1) export PATH='/home/user/bin:$PATH' or
2) the code as you suggested.
t
- kent_dorfman766
- Posts: 540
- Joined: 2022-12-16 06:34
- Location: socialist states of america
- Has thanked: 59 times
- Been thanked: 70 times
Re: Debian 11 set path at login ?
search for and use the pathmunge() shell function and make sure it and the subsequent path expansion setting are in every possible shell shartup file you can find. different system access methods invoke differing shell startup scripts.
Re: Debian 11 set path at login ?
I have experienced the same issues. After changing the ~/.profile file, the changes were not working.
For me solution was to change the following setting of the Terminal Emulator:
- Start the Terminal Emulator
- Goto the Edit Tab and select Preferences
- At the Command section: check the option Run command as login shell
For me solution was to change the following setting of the Terminal Emulator:
- Start the Terminal Emulator
- Goto the Edit Tab and select Preferences
- At the Command section: check the option Run command as login shell