0

I want to add texlive's directory to my PATH, so i type export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux and it update the PATH variable correctly. I can use commands listed in texlive path, and echo $PATH return the usual usr/bin AND texlive's path.

But when I close my terminal and open it again, it doesn't work anymore, and echo $PATH return /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin (Which is also kinda weird...).

Tried to edit .profile or .bashrc (I put export PATH=$PATH:/usr/local/texlive/2018/bin/x86_64-linux at the end), but bash doesn't seems to read it on new terminals.

TBrsx
  • 1

2 Answers2

1

I had the exact same issue. This worked.

Note: This would work only if you're using the bash shell. Run echo $SHELL on your terminal. If your terminal returns \bin\bash, then you're using bash.

  1. Remove export PATH="$PATH:YourPath" from .profile
  2. Run source .profile on the terminal in the home directory [This updates the path variables]
  3. Create .bashrc if it doesn't exit by running nano .bashrc
  4. Enter export PATH="$PATH:YourPath" into the file .bashrc
  5. Run source .bashrc

Your problem should be solved

0

Add export PATH="$PATH:<YourPath>" at the end of ~/.profile and don't forget to delete .bash_profile if you have it, because bash doesn't look at .profile if .bash_profile exists (per Why ~/.bash_profile is not getting sourced when opening a terminal?).

wjandrea
  • 14,504
TBrsx
  • 1