[Tex/LaTex] LaTeX cannot find installed packages

installing

It seems that I have two installations of TeXlive, one of which is more updated.

When I run latex, it seems to search packages inside the old installation. How can I direct latex to look for the updated installation?

All my packages in the new installation (such as tcolorbox) are listed as directories in the directory /usr/local/texlive/2015/texmf-dist/tex/latex/.

The old installation lists the package files in /usr/share/texlive/texmf-dist/tex/latex/.

Also, the command which latex gives /usr/bin/latex.

The path variable can be set in TeXstudio in options -> Configure TeXstudio -> Build.

Then tick the Show Advanced Options in the lower left corner.

Then put your path in Commands, in my case it is

/usr/local/texlive/2018/bin/x86_64-linux


click OK.

If your path is set in .bashrc to include the texlive installation, then you can test it with opening TeXstudio in a terminal which has the correct $PATH value. With which you can find the path to the pdflatex: $ which pdflatex /usr/local/texlive/2018/bin/x86_64-linux/pdflatex


and paste it into TeXstudio.