我使用的是 Manjaro Linux。我已经texlive-most
安装了。
我正在尝试使用 pandoc 从 md 制作 pdf 文件。但是,我不断收到Permission denied
错误。我尝试过使用pdflatex
和pdfroff
。
使用默认值运行--pdf-engine=pdflatex
:
$ pandoc test.md -o test.pdf
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: Permission denied
warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
kpathsea: Running mktexfmt pdflatex.fmt
mktexfmt: Permission denied
Error producing PDF.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) (preloaded format=pdflatex)
I can't find the format file `pdflatex.fmt'!
快速调查:
$ ll /usr/bin/mktexfmt
lrwxrwxrwx 1 root root 7 Nov 1 2019 /usr/bin/mktexfmt -> fmtutil
$ ll /usr/bin/fmtutil
lrwxrwxrwx 1 root root 48 Nov 1 2019 /usr/bin/fmtutil -> /usr/share/texmf-dist/scripts/texlive/fmtutil.pl
$ ll /usr/share/texmf-dist/scripts/texlive/fmtutil.pl
-rwxr-xr-x 1 root root 49K Nov 1 2019 /usr/share/texmf-dist/scripts/texlive/fmtutil.pl
$ locate pdflatex.fmt
/var/lib/texmf/web2c/pdftex/pdflatex.fmt
$ ll /var/lib/texmf/web2c/pdftex/pdflatex.fmt
-rw-r--r-- 1 root root 7.7M Jun 5 09:27 /var/lib/texmf/web2c/pdftex/pdflatex.fmt
运行--pdf-engine=pdfroff
:
$ pandoc --pdf-engine=pdfroff test.md -o test.pdf
pandoc: pdfroff: createProcess: runInteractiveProcess: exec: permission denied (Permission denied)
pandoc
可以运行sudo
,但我不想用它sudo
来生成 pdf。我看到这mktexfmt
得到了execute
许可,并且pdflatex.fmt
得到了read
每个人的许可。我还想使用默认引擎pdflatex
而不是其他引擎。
我应该如何解决这个Permission denied
问题?
答案1
我已经找出问题所在了。我sudo firecfg
在安装 pandoc 后运行,这pandoc
导致被 firejail 符号链接和沙箱化。通过sudo rm /usr/local/bin/pandoc
删除 firejail 的 pandoc 符号链接,有效地将 pandoc 从沙箱中删除,问题得到了解决。