I'm trying to install TeX Live on Ubuntu in order to use it with Pandoc. However, executing the Pandoc command gives me the error:
pdflatex not found. Please select a different --pdf-engine or install pdflatex
I followed the Quick install guide here: https://www.tug.org/texlive/quickinstall.html, and ended up with the following script:
cd /tmp
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
zcat install-tl-unx.tar.gz | tar xf -
cd install-tl-20*
sudo perl ./install-tl --no-interaction --scheme=minimal
PATH=/usr/local/texlive/2022/bin/x86_64-linux:$PATH
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr init-usertree
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr update --all
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr install plex etoolbox footmisc ragged2e lastpage appendix float ulem listings geometry sidenotes mathpazo fancyhdr titlesec xcolor biblatex booktabs caption enumitem hyperref listings
Providing the direct path to tlmgr
is a workaround to tlmgr
not being available for sudo access after installation.
There is an existing question about pdflatex
not being found. The accepted answer suggests running sudo apt install texlive-latex-base
(Link to answer). That does fix the issue, but gives me two separate TeX Live installations. Running my Pandoc command afterwards fails with 'footnote.sty' not found, which I installed previously, so it clearly uses the other distribution.
I read somewhere that one should install TeX Live via the Quick install guide from above instead of through e.g. Ubunut's package manager, because they often are outdated. When I try to just install the texlive package via sudo apt install texlive
, and then try to install packages via tlmgr
, I indeed get the Local TeX Live is older than remote repository
error that many questions on here also address.
So, it seems that the Quick install doesn't install pdflatex
properly, even though everything I find says that it is supposed to be included. Does anybody know how to solve this, i.e. install TeX live properly? Perhaps I made a mistake when adjusting the commands from the install guide, but I can't figure out what.
PATH=/usr/local/texlive/2022/bin/x86_64-linux:$PATH
in your setup files so it is in your environment, not just the shell used for installexport PATH=
didn't have an effect either. In both cases, I can see it is added when typing$PATH
. I have tried to run this on multiple fresh Ubuntu installations now and always get the same error.ls -l /usr/local/texlive/2022/bin/x86_64-linux/pdflatex
to check it is there. So your question is just a linux question how to set the path, not really tex relatedsudo apt install texlive, and then try to install packages via tlmgr,
for the apt tex, install packages via apt not tlmgr (but as you have texlive 2020 you could update via tlmgr once you fix the path so the right copy of tlmgr is found)pdflatex
wasn't even part of thex86_x64-linux
directory, so I don't think it is a PATH issue. I now ended up installing Tex Live using regular Ubuntu packages, even if they may be somewhat outdated. This way I could get all the packages I needed by installing several additional packages listed here: tex.stackexchange.com/a/504566/146161