2

After upgrading Ubuntu from 17.04 to 17.10, ~/.profile file has suddenly stopped running on login. Therefore, the script below, which is located in ~/.profile isn't run

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

How to make ~/.profile run again on startup? Thanks in advance!

AlonL
  • 123

1 Answers1

4

The issue is that Ubuntu 17.10 uses Wayland as the default desktop session - which unlike traditional X-Windows desktops, does not invoke a user's login shell (or in fact any shell).

The recommended workaround from Initiatives/Wayland/Session Start GNOME Wiki is given as follows:

The simplest way to set environment variables for a single user under systemd (version 233 or later), is to create a .conf file in ~/.config/environment.d, containing lines of the form NAME=VAL. See the environment.d documentation for more details.

GDM also supports the /usr/share/gdm/env.d/ drop-in directory. Files dropped in there also contain lines of the form NAME=VAL. These affect all users of the system.

For additional discussion see the article GNOME, Wayland, and environment variables.

steeldriver
  • 136,215
  • 21
  • 243
  • 336