0

What is configured wrong or how do I find out?

I expect my pdflatex command to function.

$ pdflatex file.tex 
bash: /usr/local/texlive/2016/bin/x86_64-linux/pdflatex: file not found

It does not. More explicitly called pdflatex starts correctly.

$ /usr/local/bin/pdflatex file.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
restricted \write...

I recently deleted and purged with apt texlive 2016. However, what can be configured wrong?

$ which pdflatex
/usr/local/bin/pdflatex
$ ll /usr/local/bin/pdflatex
lrwxrwxrwx 1 root staff 49 Jul  1 11:07 /usr/local/bin/pdflatex -> /usr/local/texlive/2017/bin/x86_64-linux/pdflatex
  • 1
    What is output of type pdflatex? – roaima Jul 1 '17 at 13:07
  • @roaima $ type pdflatex pdflatex is hashed (/usr/local/texlive/2016/bin/x86_64-linux/pdflatex) – Stefan Bollmann Jul 1 '17 at 13:13
  • Ok, in another bash window type gives a different result and pdflatex reacts as expected. So, somewhere in my session the change was not reset. – Stefan Bollmann Jul 1 '17 at 13:15
  • 2
    See What does “rm is hashed” mean? – steeldriver Jul 1 '17 at 13:32
4

Your first command is referencing the 2016 version, that you've purged. The second and third segments reference the 2017 version, which you demonstrate works as expected.

bash, in common with other shells, keeps track of which commands are in which directory. (This avoids a $PATH search on every invocation.) Now you've changed the target directory you need to tell the shell to clear its cache and start over

hash       # Optionally, show the contents of the hash list
hash -r    # Reset (clear) the hash list

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.