为什么我无法在 Ubuntu 20.04 中完全卸载 texlive?

为什么我无法在 Ubuntu 20.04 中完全卸载 texlive?

我在 Ubuntu 20.04 上。出于很多原因,我想在重新安装之前完全删除任何与 LaTeX 相关的内容。我一步一步地按照这里的答案操作,但每次我输入

pdflatex --version

我得到的输出是

pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

需要说明的是,我尝试了“sudo apt remove”和“sudo apt remove --purge”等所有组合,还删除了 /usr/local/texlive 文件夹。我这样做应该能够卸载 texlive 吧?

答案1

不幸的是,我发现从你的发行版中删除它的方法不止一种LaTeX

正如Raven所建议的那样这里pdflatex,即使您尝试删除它,它也可能仍在您的 PATH 中。
因此,请先尝试运行该命令which pdflatex
此时,如果您看到返回了路径,则 pdflatex 可执行文件仍在您的计算机中。

我过去的做法是通过修改shell的配置文件来删除它。

例如,如果您使用的是 Bash shell,则可以编辑文件~/.bashrc并删除引用 pdflatex 可执行文件的任何行。完成此操作后,您可以通过运行来检查别名alias pdflatex

如果返回别名,那么您可以使用 将其删除unalias pdflatex

最坏的情况:该pdflatex命令由您系统上安装的另一个包提供。您必须找出哪个包,然后将其删除。

现在你可以自由地走了

相关内容