更新软件包后,LaTeX 无法编译:“MiKTeX 配置实用程序”未成功

更新软件包后,LaTeX 无法编译:“MiKTeX 配置实用程序”未成功

今天早上我在 MikTeX 控制台中更新了我的软件包,但似乎不知何故破坏了我的 LaTeX 发行版。几天前一切都运行正常,但现在却不行了。通常我会尝试重新安装 MikTeX,但在回复问题,Ulrike Fischer 说要少花点时间卸载和重新安装,多花点时间尝试解决问题,所以我在这里寻求帮助。

我的问题归结为:每当我尝试使用 LaTeX(无论是通过 LaTeX 还是 PDFLaTeX)在命令提示符或 TeXMaker 中编译文档时,都会失败。我在 Windows 10 Pro(版本 2004)上运行仅用户模式的 MikTeX 安装。我通常使用 TeXMaker 作为我的编辑器(版本 5.0.3),我的 MikTeX 控制台是版本 4.0.1。我尝试了以下操作:

  • 如上所述,在命令行中进行编译,并在许多类似的问题中提出建议
  • 按照建议删除.fndb中的文件C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\data\le上次更新后更新 FNDB 时出错
  • 安装所有以“miktex”开头的软件包,更新软件包,然后重新启动,如MiKTeX 无法排版

这是我一直在使用的测试文件,名为“Test.tex”:

\documentclass[12pt]{scrartcl}
\begin{document}
Testing
\end{document}

当我在 LaTeX 的命令行中编译它时

C:\Users\amize\XXXXX>latex Test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11)

Sorry, but latex did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\latex.log

使用 PDF LaTeX 我得到

C:\Users\amize\XXXXX>pdflatex Test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11)

Sorry, but pdflatex did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log

当我尝试在 TeXMaker 中编译时,我遇到了基本相同的错误,但我还收到了以下弹出消息

PDFLaTeX TeXMaker 错误

LaTeX TeXMaker 错误

调出的日志文件如下:首先latex.log

2020-11-27 19:59:53,825-0600 INFO  latex - this process (6500) started by 'cmd' with command line: latex Test.tex
2020-11-27 19:59:53,840-0600 INFO  latex - allowing known shell commands
2020-11-27 19:59:53,840-0600 INFO  latex - enabling input (output) from (to) processes
2020-11-27 19:59:53,892-0600 INFO  latex - going to create file: latex.fmt
2020-11-27 19:59:53,947-0600 INFO  latex.core - start process: initexmf --enable-installer --dump-by-name=latex --engine=pdftex
2020-11-27 19:59:57,101-0600 ERROR latex - C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\initexmf.exe did not succeed; exitCode: 1
2020-11-27 19:59:57,101-0600 ERROR latex - output:
2020-11-27 19:59:57,101-0600 ERROR latex - 
Sorry, but "MiKTeX Configuration Utility" did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\initexmf.log

2020-11-27 19:59:57,101-0600 FATAL latex.core - The memory dump file could not be found.
2020-11-27 19:59:57,101-0600 FATAL latex.core - Data: fileName="latex.fmt"
2020-11-27 19:59:57,101-0600 FATAL latex.core - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp:715
2020-11-27 19:59:57,101-0600 FATAL latex - The memory dump file could not be found.
2020-11-27 19:59:57,101-0600 FATAL latex - Info: fileName="latex.fmt"
2020-11-27 19:59:57,101-0600 FATAL latex - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp
2020-11-27 19:59:57,101-0600 FATAL latex - Line: 715
2020-11-27 19:59:57,102-0600 INFO  latex - this process (6500) finishes with exit code 1

然后pdflatex.log

2020-11-27 20:00:13,616-0600 INFO  pdflatex - this process (3436) started by 'cmd' with command line: pdflatex Test.tex
2020-11-27 20:00:13,625-0600 INFO  pdflatex - allowing known shell commands
2020-11-27 20:00:13,626-0600 INFO  pdflatex - enabling input (output) from (to) processes
2020-11-27 20:00:13,659-0600 INFO  pdflatex - going to create file: pdflatex.fmt
2020-11-27 20:00:13,707-0600 INFO  pdflatex.core - start process: initexmf --enable-installer --dump-by-name=pdflatex --engine=pdftex
2020-11-27 20:00:16,924-0600 ERROR pdflatex - C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\initexmf.exe did not succeed; exitCode: 1
2020-11-27 20:00:16,924-0600 ERROR pdflatex - output:
2020-11-27 20:00:16,924-0600 ERROR pdflatex - 
Sorry, but "MiKTeX Configuration Utility" did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\initexmf.log

2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - The memory dump file could not be found.
2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - Data: fileName="pdflatex.fmt"
2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp:715
2020-11-27 20:00:16,925-0600 FATAL pdflatex - The memory dump file could not be found.
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Info: fileName="pdflatex.fmt"
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Line: 715
2020-11-27 20:00:16,925-0600 INFO  pdflatex - this process (3436) finishes with exit code 1

最后initexmf.log(对于上述两次尝试)

2020-11-27 19:59:54,232-0600 INFO  initexmf - this is MiKTeX Configuration Utility 4.1 (MiKTeX 20.11)
2020-11-27 19:59:54,233-0600 INFO  initexmf - this process (10216) started by 'latex' with command line: initexmf --enable-installer --dump-by-name=latex --engine=pdftex
2020-11-27 19:59:54,233-0600 INFO  initexmf - Operating on the private (per-user) MiKTeX setup
2020-11-27 19:59:54,243-0600 INFO  initexmf - running: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 19:59:54,299-0600 INFO  initexmf.core - start process: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 19:59:57,093-0600 ERROR initexmf - sub-process error output has been saved to 'C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makefmt_2020-11-27-195957.out'
2020-11-27 19:59:57,093-0600 FATAL initexmf - The executed process did not succeed.
2020-11-27 19:59:57,093-0600 FATAL initexmf - Info: fileName="C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\miktex-makefmt.exe", exitCode="1"
2020-11-27 19:59:57,093-0600 FATAL initexmf - Source: 
2020-11-27 19:59:57,093-0600 FATAL initexmf - Line: 0
2020-11-27 19:59:57,094-0600 INFO  initexmf - this process (10216) finishes with exit code 1
2020-11-27 20:00:13,993-0600 INFO  initexmf - this is MiKTeX Configuration Utility 4.1 (MiKTeX 20.11)
2020-11-27 20:00:13,993-0600 INFO  initexmf - this process (4632) started by 'pdflatex' with command line: initexmf --enable-installer --dump-by-name=pdflatex --engine=pdftex
2020-11-27 20:00:13,993-0600 INFO  initexmf - Operating on the private (per-user) MiKTeX setup
2020-11-27 20:00:14,004-0600 INFO  initexmf - running: miktex-makefmt.exe --engine=pdftex --dest-name=pdflatex --no-dump pdflatex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 20:00:14,060-0600 INFO  initexmf.core - start process: miktex-makefmt.exe --engine=pdftex --dest-name=pdflatex --no-dump pdflatex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 20:00:16,917-0600 ERROR initexmf - sub-process error output has been saved to 'C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makefmt_2020-11-27-200016.out'
2020-11-27 20:00:16,917-0600 FATAL initexmf - The executed process did not succeed.
2020-11-27 20:00:16,917-0600 FATAL initexmf - Info: fileName="C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\miktex-makefmt.exe", exitCode="1"
2020-11-27 20:00:16,917-0600 FATAL initexmf - Source: 
2020-11-27 20:00:16,917-0600 FATAL initexmf - Line: 0
2020-11-27 20:00:16,918-0600 INFO  initexmf - this process (4632) finishes with exit code 1

子进程错误输出文件的内容有点长,对此我深表歉意(我不知道如何附加文件)。它们都以同样的方式结束,

! Undefined control sequence.

<argument> \document 

这是miktex-makefmt_2020-11-27-195957.out

Running miktex-pdftex.exe...
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (INITEX)

entering extended mode

("C:/Users/amize/AppData/Local/Programs/MiKTeX 2.9/tex/latex/00miktex/latex.ini

"

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/generic/config\pdftexconfig.tex)



("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\latex.ltx"

("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\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, parameters,

LaTeX2e <2020-10-01> patch level 2

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.ltx

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3-code.tex

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\l3deprecation.def

))

! Undefined control sequence.

<argument> \document 

                     

l.91

这是miktex-makefmt_2020-11-27-200016.out

Running miktex-pdftex.exe...
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (INITEX)

entering extended mode



("C:/Users/amize/AppData/Local/Programs/MiKTeX 2.9/tex/latex/00miktex/pdflatex.

ini"

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/generic/config\pdftexconfig.tex)



("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\latex.ltx"

("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\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, parameters,

LaTeX2e <2020-10-01> patch level 2

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.ltx

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3-code.tex

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\l3deprecation.def

))

! Undefined control sequence.

<argument> \document 

                     

我的问题是:发生了什么?我该如何解决这个问题?这感觉像是我本地安装时出现的问题,但我对 LaTeX 后端没有足够的经验,不知道去哪里查找错误。这只是一个“重新安装所有内容”的情况,还是比这更容易或更难?任何帮助都将不胜感激。

更新时间:2020 年 11 月 29 日 16:19 CST

这是我的 TEXMF 根目录和链接目标目录,它们似乎是MikTeX 文档

TEXMF 根目录和链接目标目录

答案1

几年前,当我开始使用 MikTeX 时,我在从控制台更新期间遇到了同样的问题,并且无法轻松返回。

现在我有一个更保守的方法。(我以前尝试过使用两台双机,并使用虚拟机来测试新安装。但这种方法更快)

  1. 我可能每年都会这样做一次,而且只在项目之间进行。也许我会等一段时间,直到尘埃落定后再发布新版本。

  2. 作为管理员,我更改了 MikTeX 安装目录的名称。(在 Windows 中共有四个):

    C:\Program Files\MikTeX

    C:\Program Data\MikTeX

    C:\Users\username\AppData\Local\MikTeX

    C:\Users\username\AppData\Roaming\MikTeX

C:\Program Files\MikTeX feb20 OK

C:\Program Data\MikTeX feb20 OK

C:\Users\username\AppData\Local\MikTeX feb20 OK

C:\Users\username\AppData\Roaming\MikTeX feb20 OK
 

其中feb20是当前安装的日期,OK表示该安装已运行了一段时间并且经过了充分的测试。

  1. 然后我以管理员身份使用最新的安装程序安装基本的 MikTeX。

  2. 最后我进行了几次测试。我将 3 或 4 个旧项目复制到一个新目录中,这对内存、字体和包数量要求很高。

我可能需要一段时间才能满意并确认新安装可以运行。我逐行比较新日志和旧日志,并使用 Adob​​e Acrobat 比较功能比较 pdf 输出。

在我的工作中,能够至少精确地重现两年前的文档的结果非常重要。

如果出现不可接受的情况(最糟糕的情况可能是编译时出现错误,但有时情况更微妙),我会添加No OK新创建的目录的 4 个名称,并将旧目录的名称更改为其原名。然后我验证旧项目的副本现在可以再次运行而不会出现问题。

使用这种方法,唯一需要额外花费的时间就是下载所有软件包。可能要花几个小时,但它为我打下了良好的基础,让我可以立即恢复工作,而不会惊慌失措。我将整个字体集保存在一个单独的个人目录中。

作为奖励,我摆脱了那些尝试过一次但从未再使用过的软件包;另外还清理了 lua 缓存、字体数据库等。

我知道这听起来像是奶奶的菜谱,但多年来它一直让我受益匪浅。

(顺便说一句,amizener 的问题可能与需要具有管理员权限才能安装有关,从这个意义上说,Windows 10 非常挑剔且烦人。更不用说防病毒软件了)

答案2

我相信我暂时解决了这个问题。按照 Simon Dispa 在他的回答中的建议,我备份了不工作(但未受干扰)的数据库结构以供后人使用,然后Ulrike Fischer 的评论在另一个问题上,将所有文件AppData\Roaming\MiKTeX\2.9与工作目录结构进行比较(来自我的笔记本电脑)。

有一个很多额外的文件夹,尤其是AppData\Roaming\MiKTeX\2.9\tex\\AppData\Roaming\MiKTeX\2.9\tex\generic,但删除它们后,我刷新了 FNDB,LaTeX 再次编译。我不喜欢这种解决方法,但它有效,所以我不会让完美成为好的敌人,我会考虑暂时解决这个问题。

感谢 Ulrike 和 Simon 的帮助。

答案3

我也遇到过这种情况。所以我从控制台重新运行了更新,并被提示修复了两个 miktex 核心文件。然后我重启了电脑以防万一。现在它可以正常工作了。而且我已经很长时间没有更新 miktex 了。也许这会加剧问题?

相关内容