Failure to load .bash_profile

Brad R Sunday 30 August 2020 - 13:57:39  

Like many people, I set a bunch of environment variables in my .bash_profile file. Including $PATH, which is altered to include my ~/bin directory. Recently I discovered that a utility program had disappeared, and a bit of sleuthing revealed that my $PATH did not include ~/bin. Indeed, none of the environment variables in .bash_profile were being set. Why?

Unusually, a web search didn't offer much help. Some pages told me that .bash_profile would only be sourced in "interactive login mode" (text mode login), which didn't square with my experience over the last many years. I was also told that .profile would be executed for a graphical login, but that wasn't happening either.

Finally I stumbled across this helpful page that did a much better job explaining the login sequence...and told me about the .xsession file. In graphical login mode, it is .xsession that loads .bash_profile. A quick check revealed that, in the process of upgrading to Debian 10, I had inadvertently removed that file.

I've now restored .xsession, and all is well.
printer friendly