使用 tlmgr 安装(无需 sudo);安装到 ~/texmf

使用 tlmgr 安装(无需 sudo);安装到 ~/texmf

我通过下载、提取并运行安装了 texlive sudo ./install-tl

我想使用 tlmgr 安装包,例如

jdoe@jdoe:~$ tlmgr install moderncv
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2015/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.

现在,我猜如果我使用 sudo,它将运行而不会出错,但我还没有尝试过。我以为它会安装到 ~/texmf,这不需要 sudo,这也是我所希望的。

  • 它不是应该安装到 ~/texmf,因此不需要 sudo 吗?
  • 我如何安装到 ~/texmf?

答案1

tlmgr默认情况下,安装到原始安装的位置(就您而言)/usr/local/texlive/2015。这是多用户环境中的常见做法,并且只有 root 或类似的管理员才能更改安装,这也是正确的。

有一种特殊模式tlmgr,称为用户模式,允许将某些软件包安装到任意树中,默认情况下TEXMFHOME~/texmf。为此,您必须先运行tlmgr init-usertree,然后才能使用安装软件包tlmgr --usermode ...。我建议先阅读文档中的相关部分:https://www.tug.org/texlive/doc/tlmgr.html#USER-MODE

最后,如果您可以运行sudo我建议通过管理(即安装、删除等)TeX Live 安装sudo tlmgr,否则您可能会得到同一个包的多个副本,其中一些已经过时。

答案2

Norbert 的回答简化:(我也需要-ignore-warning

tlmgr init-usertree
tlmgr -ignore-warning --usermode install acro datetime2 elsarticle inputenx newunicodechar pdfcomment pstool soulutf8 tablefootnote tabu textpos threeparttable wrapfig

相关内容