I added a few things to my PATH variable in .profile on a fresh install of Debian Buster, but inspecting the environment on reboot, I see that nothing changed. What could be the problem?

The added line is:


On further inspection, it only does not get sourced if I login through a graphical login. Logging into a virtual console sources everything properly.


The file .profile is sourced by a login shell.

It seems the terminal windows created by your graphical system don't create login shells. If you use bash as your shell, you can either have them started as bash -login to source .profile, or you can put your commands in `.bashrc'.

If you use another shell, consult the documentation.

  • I use Debian from ca 2002. During all those years I've been working with various graphical systems and they have all been creating a login shell. The only change from the usual way I set up my Debian system is that I have XFCE alongside Gnome and Fluxbox. The login manager is the default Debian login manager. Also, I have noticed that when I "su" the /usr/sbin is not in the PATH. This means that evne /etc/profile was not sourced. I think something either changed in how the system boots (systemd?), or my setup is somehow botched. – Mali Remorker Aug 28 '18 at 5:43
  • The command su doesn't create a login shell, while su -i does. The login manager doesn't matter, what matters is how the shell in your terminal is started. – RalfFriedl Aug 28 '18 at 5:47
  • Turns out that lightdm, the default display manager, did not initialise using .profile, or /etc/profile. Got rid of it and installed good old xdm. Now all works. – Mali Remorker Aug 29 '18 at 5:57

I use Debian Buster with Mate, and for that in the mate console mark the option "Run command as a login shell" to load the variables from the file .profile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.