tlmgr 如何禁用切换到用户模式?

tlmgr 如何禁用切换到用户模式?

每次我运行tlmgr安装软件包时,都会收到以下消息:

$ sudo tlmgr install xetex
(running on Debian, switching to user mode!)
tlmgr: package repository http://ftp.gwdg.de/pub/ctan/systems/texlive/tlnet
Package luatex is not relocatable, cannot install it in user mode!
Package pdftex is not relocatable, cannot install it in user mode!
Package xetex is not relocatable, cannot install it in user mode!

因此没有安装任何包,尽管我已经使用sudo,但它tlmgr会自动切换回用户模式,这是我不想要的(据我所知)。

我该如何修复此行为并安装软件包?

附加信息

$ tlmgr --version
tlmgr revision 39298 (2016-01-07 03:44:29 +0100)
tlmgr using installation: /usr/local/texlive/2015
TeX Live (http://tug.org/texlive) version 2015

使用tlmgrinstall-tl以下脚本这里, 使用:

sudo ./install-tl-ubuntu

输出which

$ which tlmgr
/opt/texbin/tlmgr

输出sudo which

$ sudo which
/usr/bin/tlmgr

答案1

您有两个 TeX Live 安装。一个来自发行版(在 /usr 中),另一个来自 TUG 安装程序(在 /opt 中)。问题是,当您使用 sudo 时,路径会被重置,并且会使用 /usr/bin 中的 tlmgr,因此在 TUG 安装中不起作用。

您还需要为 root 用户调整 PATH 变量,或者 - 在我看来更好 - 如果它是一个单用户系统,则将 /opt/texlive 中文件的所有权更改为您的用户 ID,然后您就可以使用 tlmgr 而无需 sudo。

相关内容