0

I installed Ubuntu in Virtualbox in a MacBook Pro laptop. In ~/.bash_profile, I added some directories to PATH. But after I reboot the guest Ubuntu, the added directories are not in PATH. I wonder why ~/.bash_profile isn't executed after the guest Ubuntu starts. Thanks.

Tim
  • 101,790
  • Are you sure you're running bash? /bin/sh links to dash in recent Ubuntu. – choroba Jun 27 '16 at 11:56
  • Right. It links to dash, which I didn't know. (1) Shall I put the change to PATH in ~/.profile? (2) How does one find out what the current running shell is, e.g. bash, dash, zsh? – Tim Jun 27 '16 at 12:06
  • (1) https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path (2) https://unix.stackexchange.com/questions/96305/which-shell-i-am-running-on – JigglyNaga Jun 27 '16 at 12:13

1 Answers1

3

You should put your environment variables in ~/.profile.

In this file you can also place environment variable assignments, since it gets executed automatically by the DisplayManager during the start-up process desktop session as well as by the login shell when one logs in from the textual console.

https://help.ubuntu.com/community/EnvironmentVariables#A.2BAH4-.2F.profile

Petr Razumov
  • 151
  • 6