解决方案

解决方案

我运行以下命令失败,首先得到奇怪的输出 404,然后得到未知的哈希值wget

root@masi:/home/masi/Documents/# tlmgr update --self

输出

(running on Debian, switching to user mode!)
TLDownload::get_file: response error: 404 File 'texlive.tlpdb.xz' not found (for ftp://ftp.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz)
TLUtils::download_file: persistent connection ok, but download failed: ftp://ftp.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
TLUtils::download_file: retrying with wget.
TLUtils::download_file: retry with wget succeeded: ftp://ftp.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz
Unknown directive ...containerchecksum c59200574a316416a23695c258edf3a32531fbda43ccdc09360ee105c3f07f9fb77df17c4ba4c2ea4f3a5ea6667e064b51e3d8c2fe6c984ba3e71b4e32716955... , please fix it! at /usr/share/texlive/tlpkg/TeXLive/TLPOBJ.pm line 210, <$retfh> line 5579.

问题发生于2016年11月27日和12月30日。

关于 TeXLive 版本的困惑

我执行以下操作,表明 TeXLive 2015 作为 root:

root@masi:/home/masi# tex -version
TeX 3.14159265 (TeX Live 2015/dev/Debian)
kpathsea version 6.2.1dev
Copyright 2014 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.

我运行为masi

masi@masi:~$ tex --version
TeX 3.14159265 (TeX Live 2016)
kpathsea version 6.2.2
Copyright 2016 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.

我运行xelatex任何表明2016年TeXLive作为masi

(/usr/local/texlive/2016/texmf-dist/tex/latex/l3experimental/l3str/l3flag.sty)

也作为masi

command -v tlmgr
/usr/local/texlive/2016/bin/x86_64-linux/tlmgr

也作为masi

command -v tex
/usr/local/texlive/2016/bin/x86_64-linux/tex

TeXLive:2016、2015
操作系统:Debian 8.5
说明:如何更新我的 TeX 发行版?

答案1

问题: 中的路径不同masiroot因此su -p在转到 . 时不要更改路径root。我的解决方法建议

su -p
tlmgr update --self

输出

tlmgr: package repository http://mirror.datacenter.by/pub/mirrors/CTAN/systems/texlive/tlnet (verified)
tlmgr: saving backups to /usr/local/texlive/2016/tlpkg/backups
tlmgr: no self-updates for tlmgr available.

答案2

解决方案

当您进入 root 状态时,请使用此sudo -sE或此su -p来保留当前会话中的环境变量。

解释

您的系统为不同的用户使用不同的texlive版本,这是因为环境变量PATH

当您在终端中输入命令时,shell 将在您的PATH目录中查找相应的程序。但问题是,当 shell 在PATH.例如,我有这个PATH变量:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin:/snap/bin

如果我date在终端中输入,外壳程序将date在目录中查找程序/usr/local/sbin,如果没有找到,他将查找/usr/local/bin,如果没有找到......直到他查找所有目录。

当您手动安装texlive2016 时,在某些时候您使用了指令PATH=/usr/local/texlive/2016/bin/x86_64-linux/:$PATH。这样,/usr/local/texlive/bin/x86_64-linux/如果您键入任何命令,您的 shell 就会首先在目录中查找。唯一的问题是下面的说明并未适用于所有用户,因此当您获得 root 权限时,您的PATH变量将恢复为其原始内容。

这就是为什么当执行相同的命令时,masiroot会给你两个不同的程序。解决方案是使用sudo -sEsu -p保留以前用户的环境变量。

相关内容