使用 sudo 运行时未找到命令

使用 sudo 运行时未找到命令

我安装了 TexLive 2021,并通过更新文件设置了我的 PATH ~/.bashrc。因此我可以运行所有命令,但不能运行sudo

~$ tlmgr install book
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2021/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
~$ sudo tlmgr install book
sudo: tlmgr: command not found

怎么可能?

答案1

尝试完整路径tlmgr,即

sudo /usr/local/bin/tlmgr install book

将路径调整为您的设置。

相关内容