Installing LaTeX on Linux (CentOS7)

Jack Tsai
3 min readFeb 14, 2020

--

I have had the idea of learning LaTeX for a long time while I didn’t have enough time to do it.

After starting my PhD study in Germany, I’ve found that all my colleagues use LaTeX instead of Microsoft Word to document stuffs (from a few pages of report or technical papers to the whole PhD dissertation). They even exploit LaTeX to deal with complicated tasks like drawing the RF Smith Chart!

Today, I start to build the whole Tex-environment on my CentOS7 Linux System from scratch. Here I would like to make some key records, since the resources about LaTeX on Linux are distributive which took me some time to collect them. I hope this note may help someone who will be also doing the same thing in the future.

Step1

  1. download TeX Live from http://tug.org/texlive/acquire-netinstall.html
  2. go down to root, and then
    #./install_tl
    if it appears Can’t locate Digest/MD5.pm in @INC….. and related messages, means that the Linux has lack of some packages.
    Under CentOS, we can use ‘yum’ to deal with this issue.
    #yum -y install perl-Digest-MD5
    Afterwards, the error messages should be solved. And the Tex Live installation can go well. The whole installation takes about 30 min.
  3. Write a source script with MANPATH/INFOPATH/PATH
    Under bash environment, the file could be like this:
    #!/bin/sh
    #
    echo “Setting up TexLive…”
    export PATH=$PATH:/usr/local/texlive/2019/bin/x86_64-linux
    export MANPATH=$MANPATH:/usr/local/texlive/2019/texmf-dist/doc/man
    export INFOPATH=$INFOPATH:/usr/local/texlive/2019/texmf-dist/doc/info
  4. Now we test if the Tex Live is installed completely and well.
    [jacktsai@dyn-129 LaTEX]$ tex — version
    TeX 3.14159265 (TeX Live 2019)
    kpathsea version 6.3.1
    Copyright 2019 D.E. Knuth.
    There is NO warranty. Redistribution of this software is
    covered by the terms of both the TeX copyright and
    the Lesser GNU General Public License.
    For more information about these matters, see the file
    named COPYING and the TeX source.
    Primary author of TeX: D.E. Knuth.
  5. And we can also compile a file directly to see if there is any trouble. I use a file called texTest.tex with the contents of “Hello, World!”
    [jacktsai@dyn-129 LaTEX]$latex texTest.tex
    %this will produce three files with filename extentions of aux, dvi, and log
    [jacktsai@dyn-129 LaTEX]$xdvi texTest.dvi
    %to show the dvi document
    [jacktsai@dyn-129 LaTEX]$pdflatex texTest.tex
    %to generate pdf file directly

Step 2

Now we need to move forward to download the LaTeX Editor/IDE. There are a bunch of editors available such as TeXmaker, TeXstudio. Some of them only support Windows. In order to go well on CentOS (RedHat), I choose TeXstudio. (https://www.texstudio.org/)

  1. The downloaded file is rpm file which can be executed by the command
    [root@dyn-129 LaTEX]# rpm -ivh texstudio-qt4–2.12.22–2.1.x86_64.rpm
  2. However, there appeared errors:
    error: Failed dependencies:
    libQtCore.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libQtGui.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libQtNetwork.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libQtScript.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libQtSvg.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libQtXml.so.4()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
    libpoppler-qt4.so.14()(64bit) is needed by texstudio-qt4–2.12.22–2.1.x86_64
  3. Again, we can use ‘yum’ to install those missing packages. But there are too many this time. To save time, we can use the following command to pack them at a click.
    #yum localinstall texstudio-qt4–2.12.22–2.1.x86_64.rpm
    Then, execute the rpm file again…
    # rpm -ivh texstudio-qt4–2.12.22–2.1.x86_64.rpm
  4. There would be KEY problem
    warning: texstudio-qt4–2.12.22–2.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID ea279317: NOKEY
    But this doesn’t matter in the end, so let us ignore it.

Finally, combining Step1 & Step2, we can open the TeXstudio.

[jacktsai@dyn-129 LaTEX]$ source texlive.cshrc
Setting up TexLive…
[jacktsai@dyn-129 LaTEX]$ texstudio &

--

--

Jack Tsai

理工宅、直覺系、卡爾斯魯爾、德國、博士班