MikTex下载安装package失败(报错关键信息:FATAL xelatex - The installed file does not exist.)

时间:2024-03-30 14:36:38

前言

我的环境是MikTex+TeXStudio。最近MikTex一直无法自动下载安装package,导致编译失败,出现错误:

Sorry, but C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\miktex-pdftex.exe did not succeed.

The log file hopefully contains the information to get MiKTeX going
again:
C:/Users/xxx/xxx/MiKTeX/2.9/miktex/log/xelatex.log

找到对应的xelatex.log 一看:

MikTex下载安装package失败(报错关键信息:FATAL xelatex - The installed file does not exist.)

之前好几次没解决,今天终于找到解决方案了,在此记录。

1 之前的代替解决方案

之前都是打开:miktex(管理员模式),然后手动下载这些package。

MikTex下载安装package失败(报错关键信息:FATAL xelatex - The installed file does not exist.)

但是!这并没有解决问题,而且费时间。

2 完全解决方案

1) alt + R键调出命令行(管理员模式):
MikTex下载安装package失败(报错关键信息:FATAL xelatex - The installed file does not exist.)

2) 输入:mpm --update-db --admin即可。

MikTex下载安装package失败(报错关键信息:FATAL xelatex - The installed file does not exist.)

3) 此时再次在TeXStudio中进行编译,发现已经不再报错了。nice

小结

1)搜索解决方案的时候,一定要找对关键字。

一开始我已经准备重新安装了,但是我觉得这不是办法。所以再最后试了一次,换了关键词:
Source: Libraries\MiKTeX\Core\Session\findfile.cpp line 59
这次正确答案就在排名靠前的结果中,所以。关键词真的很重要。
(之前没有输入合适的关键词,导致找到了很多误导性的解决方案,十分危险)

2)保持清醒的头脑对解决问题有重要影响,之前好几次都没解决,今天解决了,可能是因为:#1 有之前的探索在铺路;#2 头脑清醒,选对了关键词。

参考文献

[1] “The installed file does not exist.” on Linux #440 https://github.com/MiKTeX/miktex/issues/440
github是真的给力

[2] How can I tell TeXstudio not always to update Miktex
https://tex.stackexchange.com/questions/519512/how-can-i-tell-texstudio-not-always-to-update-miktex

备注:[3] - [6] 对解决问题没有帮助。

[3] MikTex Packages Download Failure
https://tex.stackexchange.com/questions/16669/miktex-packages-download-failure

[4] MikTeX asking to install package, but failing to do so
https://tex.stackexchange.com/questions/517714/miktex-asking-to-install-package-but-failing-to-do-so

[5] MiKTeX: Error After Update: “Sorry, but pdflatex did not succeed.”
https://tex.stackexchange.com/questions/500534/miktex-error-after-update-sorry-but-pdflatex-did-not-succeed

[6] tools package - “Installed file does not exist”
https://tex.stackexchange.com/questions/439352/tools-package-installed-file-does-not-exist