LoginSignup
5
1

More than 5 years have passed since last update.

TexLive2018 を CentOS6 にインストールする

Posted at

古いOSだけど今もちまちま使ってるサーバがあって、そこにあるtexを一新しようと texlive2018 をインストールしたら少しばかりハマったのでメモ書き。

現象

インストール後に lualatex とコマンドを実行したら下記のようなエラーが出て動かない。

> ./lualatex
./lualatex: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./lualatex)

要は標準でインストールされている glibc が GLIBC_2.12 である為、バージョンが合わずにコケる。

環境

$ cat /etc/centos-release                   
CentOS release 6.9 (Final)

インストールに必要物

予め Developer Tools などは yum でインストールしている事が前提。

インストール

標準インストールされている glibc2.12で、texlive 2018 からは glibc 2.14以上が必要になります。(どこにそんなの書いてるのかわからないけど、インストール中に気づいた)

glibc インストール

インストール先を /opt/local とする。

> wget https://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
> tar zxf glibc-2.14.tar.gz
> cd glibc-2.14
> mkdir build && cd build
> ../configure --prefix=/opt/local
> make -j4 # CPU数と相談。数あるから -j で増やしたほうが良さそう
> sudo make install

texlive をインストール

数時間かかるので、のんびりと待つ。下記の<任意のURL>Network Based InstallerにあるURLを選んでくださいまし。

> wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
> tar zxf install-tl-unx.tar.gz
> cd install-tl-<年月日>
> sudo ./install-tl --repository <任意のURL>
...

Summary of warnings:
./install-tl: updmap-sys --nohash failed: 
./install-tl: mtxrun --generate failed: 
./install-tl: fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-strict --all failed: 

 ----------------------------------------------------------------------
 The following environment variables contain the string "tex"
 (case-independent).  If you're doing anything but adding personal
 directories to the system paths, they may well cause trouble somewhere
 while running TeX.  If you encounter problems, try unsetting them.
 Please ignore spurious matches unrelated to TeX.

    SUDO_COMMAND=./install-tl --repository <任意のURL>
 ----------------------------------------------------------------------


Welcome to TeX Live!


See /usr/local/texlive/2018/index.html for links to documentation.
The TeX Live web site (http://tug.org/texlive/) contains any updates and
corrections. TeX Live is a joint project of the TeX user groups around the
world; please consider supporting it by joining the group best for you. The
list of groups is available on the web at http://tug.org/usergroups.html.


Add /usr/local/texlive/2018/texmf-dist/doc/man to MANPATH.
Add /usr/local/texlive/2018/texmf-dist/doc/info to INFOPATH.
Most importantly, add /usr/local/texlive/2018/bin/x86_64-linux
to your PATH for current and future sessions.

Logfile: /usr/local/texlive/2018/install-tl.log
>

上記ではインストールが最後の方でコケるのを確認できます。ですので、コケたコマンドは先にインストールした glibc を使う必要があります。


# パスを通しておかないとコケる
> export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH:$HOME/bin
>
> LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH updmap-sys --nohash;
> LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH mtxrun --generate;
> LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-strict --all

終わり処理

これを実行して、システムに支障をきたしても僕は知りません。おおよそ問題は無いはず。。。

# 環境設定
> echo 'export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH:$HOME/bin' >> ~/.bash_profile

# 標準的に glibc 2.14 を読むように
> echo 'export LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH'  >> ~/.bash_profile

参考

  1. 共有ライブラリの追加 -- https://tetsuyai.hatenablog.com/entry/20111201/1324792477
  2. How to update glibc to 2.14 in CentOS 6.5
5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1