【Linux】LaTeXのインストール方法(apt非使用):(2023年版)

投稿日: 更新日:

aptを使ってインストールすると古いのでインストーラを使ってインストールします。

💻環境

OS: Ubuntu 22.04.2 (WSL2)

インストール手順

インストーラのダウンロード

ミラーサイトからインストーラをダウンロードします。ミラーサイトはhttps://mirror.ctan.org/systems/texlive/tlnet/ を利用すると最寄りのものにリダイレクトされます。

$ curl -OL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz

インストール

ダウンロードが終わったら展開します。

$ tar xvf install-tl-unx.tar.gz

ディレクトリに移動します。

$ cd install-tl-2*

インストーラを実行します。オプションでリポジトリも指定します。

$ sudo ./install-tl --repository https://mirror.ctan.org/systems/texlive/tlnet/

以下のようになるはずです。長いので一部略してます

======================> TeX Live installation procedure <=====================

======>   Letters/digits in <angle brackets> indicate   <=======
======>   menu items for actions or customizations      <=======
= help>   https://tug.org/texlive/doc/install-tl.html   <=======

~~略~~

 <O> options:
   [ ] use letter size instead of A4 by default
   [X] allow execution of restricted list of programs via \write18
   [X] create all format files
   [X] install macro/font doc tree
   [X] install macro/font source tree
   [ ] create symlinks to standard directories

 <V> set up for portable installation

Actions:
 <I> start installation to hard disk
 <P> save installation profile to 'texlive.profile' and exit
 <Q> quit

Enter command:

Iを打ってEnterを押します。

すると、インストールが始まります。とても時間⌛がかかります。気長に待ちます。私の環境だと2時間半かかりました。

パスを追加

以下のコマンドで簡単に出来ます。

$ sudo /usr/local/texlive/20*/bin/x86_64-linux/tlmgr path add

確認

バージョンは異なる場合がありますが、以下のような出力があれば大丈夫です。

$ tlmgr --version
tlmgr revision 66798 (2023-04-08 02:15:21 +0200)
tlmgr using installation: /usr/local/texlive/2023
TeX Live (https://tug.org/texlive) version 2023

アップデート

リポジトリを指定します。この操作は初回だけ実行すれば良いです。

$ sudo tlmgr option repository https://mirror.ctan.org/systems/texlive/tlnet/

そして、以下のコマンドでアップデート出来ます。だたし、クロスリリースのアップデートは出来ません。

$ sudo tlmgr update --self --all

書いた人

profile_image

お茶の葉

物理とプログラミングが好きな人