最后在命令行中输入 tex -version,如果显示了版本的信息就说明安装成功了,比如成功安装 \(\TeX \, Live \,2024\) 会显示如下的信息:
1 2 3 4 5 6 7 8 9 10
(base) PS C:\> tex -version TeX 3.141592653 (TeX Live 2024) kpathsea version 6.4.0 Copyright 2024 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.
======================> TeX Live installation procedure <=====================
======> Letters/digits in <anglebrackets> indicate <======= ======> menu items for actions or customizations <======= = help> https://tug.org/texlive/doc/install-tl.html <=======
Detected platform: GNU/Linux on x86_64
<B> set binary platforms: 1 out of 15
<S> set installation scheme: scheme-full
<C> set installation collections: 40 collections out of 41, disk space required: 8779 MB (free: 968663 MB)
<D> set directories: TEXDIR (the main TeX directory): /usr/local/texlive/2025 TEXMFLOCAL (directory for site-wide local files): /usr/local/texlive/texmf-local TEXMFSYSVAR (directory for variable and automatically generated data): /usr/local/texlive/2025/texmf-var TEXMFSYSCONFIG (directory for local config): /usr/local/texlive/2025/texmf-config TEXMFVAR (personal directory for variable and automatically generated data): ~/.texlive2025/texmf-var TEXMFCONFIG (personal directory for local config): ~/.texlive2025/texmf-config TEXMFHOME (directory for user-specific files): ~/texmf
<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 [X] after install, set CTAN as source for package updates
<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 使用默认配置安装,安装完成后需要在 bash 中执行弹出已装载的光盘镜像:
1 2
sudo umount /mnt/f sudo rmdir /mnt/f
默认安装完成后,需要设置环境变量,继续在 bash 中执行:
1
nvim ~/.profile
如果是 zsh 则执行:
1
nvim ~/.zshrc
在打开的文件末尾添加并保存退出:
1 2 3 4
# Add TeX Live to the PATH, MANPATH, INFOPATH export PATH=/usr/local/texlive/2025/bin/x86_64-linux:$PATH export MANPATH=/usr/local/texlive/2025/texmf-dist/doc/man:$MANPATH export INFOPATH=/usr/local/texlive/2025/texmf-dist/doc/info:$INFOPATH
退出 WSL 再重新进入,执行:
1
tex -v
如果成功则会显示:
1 2 3 4 5 6 7 8 9
TeX 3.141592653 (TeX Live 2025) kpathsea version 6.4.1 Copyright 2025 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.
/usr/local/texlive/2025/texmf-dist/scripts/texdoc/texdoclib.tlu 4.1.1 Configuration file(s): active /usr/local/texlive/2025/texmf-dist/texdoc/texdoc.cnf Recommended file(s) for personal settings: /home/abel/texmf/texdoc/texdoc.cnf
这里给出了 texdoc 的配置文件所在位置,打开用户文件夹下的配置文件:
1
nvim ~/texmf/texdoc/texdoc.cnf
如果失败则要先创建相应的文件:
1 2 3
mkdir -p ~/texmf/texdoc cd ~/texmf/texdoc/ nvim texdoc.cnf