如何在 WSL 下更新 TeX Live?

如何在 WSL 下更新 TeX Live?

我想在 WSL 中使用 latex(我的“应用和功能”中显示的是 Ubuntu 18.04),因为我想要基于 Linux 的安装(使用 bash 脚本等)。我按照以下说明成功安装了 TeX Live通过互联网安装 TeX Live。我有一个/usr/local/texlive/2018没问题的,而且 latex 命令等工作正常。

我遇到的问题是更新或安装其他软件包。WSLtlmgr似乎部分崩溃了。例如,我想安装软件包和字体:

$ sudo tlmgr install collection-fontsrecommended

我收到关于 的错误Cannot find main repository, you have to tag one as main!(但也有关于缺少 的错误xzdec)。

因此,我尝试设置存储库,但仍然出现错误xzdec

$ sudo tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet
(running on Debian, switching to user mode!)
/usr/bin/tlmgr: Initialization failed (in setup_unix_one):
/usr/bin/tlmgr: could not find a usable xzdec.
/usr/bin/tlmgr: Please install xzdec and try again.
tlmgr: Couldn't set up the necessary programs.
Installation of packages is not supported.
Please report to [email protected].
tlmgr: Continuing anyway ...
tlmgr: setting default package repository to http://mirror.ctan.org/systems/texlive/tlnet

谷歌搜索xzdec包错误,我发现它可以安装sudo apt-get install xzdec。但在我的 WSL 上我得到了以下信息:

$ sudo apt-get install xzdec
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package xzdec

可以xzdec在 WSL 中安装吗?有什么窍门?有关更多信息西泽德

TeX Live 是 WSL 下 LaTeX 的最佳选择吗?

答案1

我通过更新我的 Ubuntu 18.04 解决了这个问题:

$ sudo apt-get update

它安装了一堆东西(自从从微软商店安装 WSL 以来我显然从未这样做过)。

随后,$ sudo apt-get install xzdec成功了,命令也成功了$ sudo tlmgr ...

但是,我现在意识到它与默认的 Ubuntu 18.04 latex 安装存在冲突。在安装 TeX Live (2018) 之前,请确保首先删除默认安装

相关内容