Command Not Found When Run with Sudo

Command Not Found When Run with Sudo

I installed TexLive 2021, and set my PATH by updating the ~/.bashrc file. So I can run all commands, but not with 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

How can that be?

2

1 Answer

Try the full path of tlmgr, i.e.

sudo /usr/local/bin/tlmgr install book

Adjust the path to your setting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.