适合“tl;dr”用户的简短版本:
尝试在新服务器上安装我需要的程序,许多软件包“不在存储库中”。例如:
# tlmgr install color
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package color not present in repository.
细节:
我不是 TeX 专家 - 我只在 PHP 代码中使用它来从数据库数据创建 PDF。在一位专家的大力帮助下,我在 2011 年安装了我需要的东西,但现在我需要准备一台新服务器,所以我希望最新版本的东西能让这一切变得更容易。希望就到此为止了...
我正在格式化 UTF-8 编码的日文文本,因此我需要 uplatex。但我只需要大约十几个软件包。起初我尝试安装所有 Texlive,但随机下载失败使它无法进入我不需要的大量软件包列表。所以我决定尝试一种更精致的方法,但我显然不知道我在做什么。
我以“最小方案(仅限普通)”安装开始。到目前为止一切顺利。然后我运行tlmgr install uplatex
- 它似乎已经安装(它在文本文档上运行),但安装过程中出现错误(我将粘贴整个输出以防您需要它):
# tlmgr install uplatex
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
[1/10, ??:??/??:??] install: babel [505k]
[2/10, 00:03/01:33] install: latex [12806k]
[3/10, 00:43/00:51] install: latex-fonts [19k]
[4/10, 00:44/00:52] install: latexconfig [5k]
[5/10, 00:45/00:53] install: uplatex.x86_64-linux [1k]
[6/10, 00:46/00:54] install: uplatex [862k]
[7/10, 00:50/00:55] install: uptex.x86_64-linux [1309k]
[8/10, 00:55/00:56] install: uptex [9k]
[9/10, 00:56/00:57] install: uptex-base [159k]
[10/10, 00:57/00:57] install: uptex-fonts [122k]
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in /usr/local/texlive/2016/texmf-dist
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine euptex ...
tlmgr: fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine euptex failed (status 1), output:
fmtutil: fmtutil is using the following fmtutil.cnf files (in precedence order):
fmtutil: /usr/local/texlive/2016/texmf-dist/web2c/fmtutil.cnf
fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes:
fmtutil: /usr/local/texlive/2016/texmf-config/web2c/fmtutil.cnf
fmtutil [INFO]: writing formats under /usr/local/texlive/2016/texmf-var/web2c
fmtutil [INFO]: --- remaking euptex with euptex
fmtutil: running `euptex -ini -jobname=euptex -progname=euptex *euptex.ini' ...
This is e-upTeX, Version 3.14159265-p3.7-u1.21-160201-2.6 (utf8.uptex) (TeX Live 2016) (INITEX)
restricted \write18 enabled.
entering extended mode
(/usr/local/texlive/2016/texmf-dist/tex/uptex/uptex-base/euptex.ini
(/usr/local/texlive/2016/texmf-dist/tex/uptex/uptex-base/euptex.src
(/usr/local/texlive/2016/texmf-dist/tex/uptex/uptex-base/uptex.tex
(/usr/local/texlive/2016/texmf-dist/tex/plain/base/plain.tex
Preloading the plain format: codes, registers, parameters, fonts, more fonts,
macros, math definitions, output routines, hyphenation
(/usr/local/texlive/2016/texmf-dist/tex/generic/hyphen/hyphen.tex
[skipping from \patterns to end-of-file...]))
(/usr/local/texlive/2016/texmf-dist/tex/uptex/uptex-base/ukinsoku.tex))
! I can't find file `eptexdefs.lib'.
\et@xload ...ge {Loading module "##1";}}\input #1
\def \module ##1{\iftrue }
\load ...={}}\et@xl@ad #1,\endl@ad \et@xload {#2}
\the \et@xtoks \fi
l.210 \load interactionmodes from eptexdefs.lib
%%% \load <foo>[, <bar>...] ...
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
! Emergency stop.
\et@xload ...ge {Loading module "##1";}}\input #1
\def \module ##1{\iftrue }
\load ...={}}\et@xl@ad #1,\endl@ad \et@xload {#2}
\the \et@xtoks \fi
l.210 \load interactionmodes from eptexdefs.lib
%%% \load <foo>[, <bar>...] ...
No pages of output.
Transcript written on euptex.log.
fmtutil [INFO]: --- remaking uplatex with euptex
fmtutil: running `euptex -ini -jobname=uplatex -progname=uplatex *uplatex.ini' ...
This is e-upTeX, Version 3.14159265-p3.7-u1.21-160201-2.6 (utf8.uptex) (TeX Live 2016) (INITEX)
restricted \write18 enabled.
entering extended mode
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/config/uplatex.ini
<<< making "uplatex with Babel" format >>>
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/uplatex.ltx
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/latex.ltx
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/texsys.cfg)
./texsys.aux found
\@currdir set to: ./.
Assuming \openin and \input
have the same search path.
Defining UNIX/DOS style filename parser.
catcodes, registers, compatibility for TeX 2, parameters,
LaTeX2e <2016/03/31> patch level 3
hacks, control, par, spacing, files, font encodings, lengths,
====================================
Local config file fonttext.cfg used
====================================
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fonttext.cfg
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fonttext.ltx
=== Don't modify this file, use a .cfg file instead ===
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omlenc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ot1enc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omsenc.def)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1cmr.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ot1cmr.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ot1cmss.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ot1cmtt.fd)))
====================================
Local config file fontmath.cfg used
====================================
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontmath.cfg
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/fontmath.ltx
=== Don't modify this file, use a .cfg file instead ===
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omlcmm.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omscmsy.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/omxcmex.fd)
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ucmr.fd)))
====================================
Local config file preload.cfg used
=====================================
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/preload.cfg
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/preload.ltx)) page nos.,
x-ref, environments, center, verbatim, math definitions, boxes, title,
sectioning, contents, floats, footnotes, index, bibliography, output,
===========================================
Local configuration file hyphen.cfg used
===========================================
(/usr/local/texlive/2016/texmf-dist/tex/generic/babel/hyphen.cfg
(/usr/local/texlive/2016/texmf-dist/tex/generic/babel/switch.def)
(/usr/local/texlive/2016/texmf-dist/tex/generic/hyphen/hyphen.tex)
(/usr/local/texlive/2016/texmf-dist/tex/generic/hyphen/dumyhyph.tex)
(/usr/local/texlive/2016/texmf-dist/tex/generic/hyphen/zerohyph.tex))
)
**************************
*
* making upLaTeX format
*
**************************
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/uplcore.ltx
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/upldefs.ltx
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/jy2mc.fd)
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/jy2gt.fd)
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/jt2mc.fd)
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/jt2gt.fd)
Loading kinsoku patterns for japanese.
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/ukinsoku.tex)))
pLaTeX2e <2016/09/08u01> (based on LaTeX2e <2016/03/31> patch level 3)
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
) )
Beginning to dump on file uplatex.fmt
(preloaded format=uplatex 2016.12.1)
4856 strings of total length 64788
48499 memory locations dumped; current usage is 218&48013
3554 multiletter control sequences
\font\nullfont=nullfont
\font\OMX/cmex/m/n/10=cmex10
\font\tenln=line10
\font\tenlnw=linew10
\font\tencirc=lcircle10
\font\tencircw=lcirclew10
\font\OT1/cmr/m/n/5=cmr5
\font\OT1/cmr/m/n/7=cmr7
\font\OT1/cmr/m/n/10=cmr10
\font\OML/cmm/m/it/5=cmmi5
\font\OML/cmm/m/it/7=cmmi7
\font\OML/cmm/m/it/10=cmmi10
\font\OMS/cmsy/m/n/5=cmsy5
\font\OMS/cmsy/m/n/7=cmsy7
\font\OMS/cmsy/m/n/10=cmsy10
\font\JT2/mc/m/n/10=upjisr-v at 9.6222pt
\font\JY2/mc/m/n/10=upjisr-h at 9.6222pt
\font\JY2/mc/m/n/5=upjisr-h at 4.8111pt
\font\JY2/mc/m/n/7=upjisr-h at 6.73553pt
\font\JY2/mc/m/n/12=upjisr-h at 11.54663pt
\font\JY2/gt/m/n/5=upjisg-h at 4.8111pt
\font\JY2/gt/m/n/7=upjisg-h at 6.73553pt
\font\JY2/gt/m/n/10=upjisg-h at 9.6222pt
\font\JY2/gt/m/n/12=upjisg-h at 11.54663pt
\font\JT2/mc/m/n/5=upjisr-v at 4.8111pt
\font\JT2/mc/m/n/7=upjisr-v at 6.73553pt
\font\JT2/mc/m/n/12=upjisr-v at 11.54663pt
\font\JT2/gt/m/n/5=upjisg-v at 4.8111pt
\font\JT2/gt/m/n/7=upjisg-v at 6.73553pt
\font\JT2/gt/m/n/10=upjisg-v at 9.6222pt
\font\JT2/gt/m/n/12=upjisg-v at 11.54663pt
\font\@bannerfont=cmtt9
5968 words of font info for 31 preloaded fonts
14 hyphenation exceptions
Hyphenation trie of length 6081 has 183 ops out of 35111
2 for language 1
181 for language 0
No pages of output.
Transcript written on uplatex.log.
fmtutil [INFO]: /usr/local/texlive/2016/texmf-var/web2c/euptex/uplatex.fmt installed.
fmtutil [ERROR]: running `euptex -ini -jobname=euptex -progname=euptex *euptex.ini </dev/null' return status 1
fmtutil [ERROR]: return error due to options --strict
fmtutil [INFO]: Successfully rebuilt formats: 1
fmtutil [INFO]: Not selected formats: 9
fmtutil [INFO]: Failed to build: 1 (euptex/euptex)
fmtutil [INFO]: Total formats: 11
fmtutil [INFO]: exiting with status 1
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine uptex ...
done running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-error-if-no-format --byengine uptex.
tlmgr: An error has occurred. See above messages. Exiting.
尽管出现上述错误,但 uplatex 似乎存在 -uplatex '\documentclass{ujarticle} \begin{document} Test \end{document}'
运行时没有错误。
但后来我尝试安装我需要的软件包 - 以下是前九个:
# tlmgr install plext otf fontenc lmodern geometry verbatim lscape textpos graphicx
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package fontenc not present in repository.
tlmgr install: package graphicx not present in repository.
tlmgr install: package lmodern not present in repository.
tlmgr install: package lscape not present in repository.
tlmgr install: package otf not present in repository.
tlmgr install: package plext not present in repository.
tlmgr install: package verbatim not present in repository.
[1/2, ??:??/??:??] install: geometry [228k]
[2/2, 00:05/00:12] install: textpos [325k]
tlmgr: action install returned an error; continuing.
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
tlmgr: An error has occurred. See above messages. Exiting.
最后四个:
# tlmgr install needspace hanging color ulem
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package color not present in repository.
[1/3, ??:??/??:??] install: hanging [152k]
[2/3, 00:04/00:10] install: needspace [158k]
[3/3, 00:06/00:08] install: ulem [107k]
tlmgr: action install returned an error; continuing.
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
tlmgr: An error has occurred. See above messages. Exiting.
因此,13 个软件包中有 8 个在存储库中找不到。是的,有几个可能有点晦涩难懂,但我认为大多数都很常见。那么为什么 tlmgr 找不到它们呢?
(环境:装有CentOS 7.2的虚拟机)
编辑:我尝试遵循 David Carlisle 和 Piet van Oostrum 提供的有用答案(Piet 详细介绍了 7 个软件包,David 则以“授人以渔”的方式介绍了这些软件包的工作原理),我尝试做更多,但仍然没有理解。也许 uplatex 的安装出现错误是导致部分问题的原因,但我真的不知道如何解释。
lmodern
无论如何,我在代码中将的名称更改为lm
,并成功安装了graphics
、lm
和japanese-otf
。我试过了tlmgr install required
,但它不知道我在说什么。tlmgr install latex
声称 latex 已经安装。
再次运行测试文件(使用上面提到的前 9 个包的代码),它抱怨我刚刚安装的包,甚至抱怨我从未听说过的包!我真的很困惑。以下是记录(中间有一点被剪掉),我只需在出现提示时按下 Enter 键即可:
[09:01 AM]-[root@7and7]-[/var/www]
# tlmgr install graphics
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
[1/2, ??:??/??:??] install: graphics [2000k]
[2/2, 00:05/00:05] install: graphics-cfg [2k]
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
[09:01 AM]-[root@7and7]-[/var/www]
# tlmgr install required
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package required not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: An error has occurred. See above messages. Exiting.
[09:03 AM]-[root@7and7]-[/var/www]
# tlmgr install lm
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: lm [17956k]
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
[09:08 AM]-[root@7and7]-[/var/www]
# tlmgr install graphics
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
tlmgr install: package already present: graphics
[09:13 AM]-[root@7and7]-[/var/www]
# tlmgr install japanese-otf
tlmgr: package repository ftp://ftp.kddilabs.jp/CTAN/systems/texlive/tlnet (verified)
[1/1, ??:??/??:??] install: japanese-otf [441k]
tlmgr: package log updated: /usr/local/texlive/2016/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
[09:15 AM]-[root@7and7]-[/var/www]
# uplatex test
This is e-upTeX, Version 3.14159265-p3.7-u1.21-160201-2.6 (utf8.uptex) (TeX Live 2016) (preloaded format=uplatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
pLaTeX2e <2016/09/08u01> (based on LaTeX2e <2016/03/31> patch level 3)
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/ujarticle.cls
Document Class: ujarticle 2011/05/07 v1.6-u00 Standard upLaTeX class
(/usr/local/texlive/2016/texmf-dist/tex/uplatex/base/ujsize10.clo))
! LaTeX Error: File `plext.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! LaTeX Error: File `japanese-otf.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! LaTeX Error: Unknown option `uplatex' for package `japanese-otf'.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.4 \usepackage
[T1]{fontenc}
?
...
SNIP: OTHER STUFF THAT DIDN'T LOOK RELEVANT
...
! LaTeX Error: File `lm.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
(/usr/local/texlive/2016/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty)
! LaTeX Error: File `ifpdf.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! LaTeX Error: File `ifvtex.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
(/usr/local/texlive/2016/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
! LaTeX Error: File `verbatim.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/lscape.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-def/dvips.def)))
(/usr/local/texlive/2016/texmf-dist/tex/latex/textpos/textpos.sty
Package: textpos 2016/06/07 1.8, absolute positioning of text on the page
Grid set 16 x 16 = 17.78296pt x 26.31879pt
) (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty)
No file test.aux.
*geometry* driver: auto-detecting
! Undefined control sequence.
\Gm@detectdriver ...driver: auto-detecting}\ifpdf
\Gm@setdriver {pdftex}\els...
l.13 \begin{document}
?
! Undefined control sequence.
\Gm@detectdriver ...@setdriver {dvips}\fi \ifvtex
\Gm@setdriver {vtex}\fi \i...
l.13 \begin{document}
?
那时我就放弃了。下面这个序列就是一个对我来说毫无意义的例子:
- japanese-otf 安装成功。uplatex 抱怨,“错误:文件
japanese-otf.sty
“未找到。”(什么?那么它安装在哪里了?)- uplatex 抱怨,“
uplatex
软件包的 未知选项japanese-otf
。”(如果您无法找到要启动的软件包,您怎么知道呢?)
您能更清楚地了解正在发生的事情吗?
答案1
tlmgr 的“包”是一起安装的文件单元,它不一定直接与 latex“包”相关(例如,它可能只包含字体或二进制程序),在这种情况下,color
它是 texlive 包的一部分graphics
。(查看任何文件所包含的 texlive 包的简单方法是查看该文件的 ctan 页面,例如
https://www.ctan.org/pkg/color
它显示了它所包含的 miktex 和 texlive 包。
实际上graphics
是乳胶“必需”分布的一部分,因此如果您有乳胶,您应该已经拥有包括颜色在内的图形包。
答案2
以下是有关“丢失”包的完整列表:
- fontenc:latex 分发的一部分
- lmodern:被称为“lm”
- graphicx:图形包的一部分(是必需的一部分)
- lscape:“graphics”包的一部分
- otf:可以是 japanese-otf、font-otf 或 japanese-otf-uptex 或其任意组合
- plext:platex 的一部分,因此也可能是 uplatex 的一部分
- verbatim:“必需”包的一部分