Make TeXLive download and install the necessary files

input-encodingslinuxtexlivetlmgrupdate

I am working with TeXLive 2021 in Linux Mint (English version). I need to work with Russian texts. I started from the file like this:

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[russian]{babel}

\begin{document}
123
\end{document}

There are some errors when compiling the file via latex main.tex:

! Package fontenc Error: Encoding file `t2aenc.def' not found.
(fontenc)                You might have misspelt the name of the encoding.
! LaTeX Error: Encoding scheme `T2A' unknown.
! LaTeX Error: File `cp1251.def' not found.

What I tried:

  • tlmgr update --all (hoping it will download all the necessary files…). This command made an error with checksum -5. I read a lot about it and used some advises but nothings changed.
  • texliveonfly main.tex — I also hoped it would download the necessary files but the compilation errors are the same.
  • tried to find cp1251.def and t2aenc.def over the Internet and on the PC with Windows with MikTeX where all works — I did not succeed.

I wanted to make my LaTeX system on-the-fly-like so that all the necessary packages and files are downloaded automatically (as it was in MikTeX in Windows). So the local problem is language and encoding and the global one is to make the system auto-updatable.

Best Answer

Thanks to the people who commented above, the problem is solved. I have removed both MikTeX and Kpathsea LaTeX (libkpathsea) and left only one TeXLive. Then I added the path /usr/local/texlive/2021/bin/x86_64-linux to the PATH variable. Then I did tlmgr update --all. It works now.