1

I add this to the end of ~/.profile

PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH
export PATH

but it is never saved. Close the terminal, open it again and the path is without the one to latex. What am I doing wrong?

1

By default, .profile gets only loaded in login shells. Also by default, you don't get a login shell for a GUI shell.

Either put it in e.g., .bashrc if you're in bash, or log out of your GUI sessions and then log back in.

You can also source it manually (. "$HOME/.profile") or force a login shell with --login.

I find it helpful to have echo statements in these rc files so that I can know exactly when each gets loaded.


Note: You don't need the export part. PATH already is an environment variable.

  • +1 for the echo statements in the rc files. Especially when you start spreading statements in multiple ones. – rahmu May 30 '16 at 14:17
  • Never change PATH in .bashrc: that only applies to programs started in terminals, not to programs started from the GUI, to endless confusion. Don't put echo statements in .profile, this can confuse programs that log in remotely and run .profile to get desired environment variables. – Gilles May 30 '16 at 21:11

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.