I have installed TeXLive and added /usr/local/texlive/2019/bin/x86_64-linux
to my $PATH
through /etc/environment
, so I should be able to run tlmgr
from the terminal. I am able to do that as non-root user:
johndoe@pc:~$ tlmgr update --all
tlmgr: package repository http://ftp.math.purdue.edu/mirrors/ctan.org/systems/texlive/tlnet (verified)
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2019/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
I get an error but there is nothing strange, to update the packages I obviously have to run tlmgr
as root - and that's where I am having troubles:
johndoe@pc:~$ sudo tlmgr update --all
[sudo] password for johndoe:
sudo: tlmgr: command not found
Still, if I check the content of /etc/environment
it includes /usr/local/texlive/2019/bin/x86_64-linux
:
johndoe@pc:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/texlive/2019/bin/x86_64-linux"
In a previous Ubuntu installation I managed to fix that, so I'm certain that there is a way to do that, but I don't have a clue about what I did. Any suggestion?
I don't know what additional information could be useful, please ask in the comments if needed.
Update
I'm working with Ubuntu 19.10 (Eoan Ermine). I installed TeXLive "over the internet" because the "Acquire TeX Live" page recommends to do so.
I am also having this problem. Specifically:
tlmgr
.tlmgr
, giving "sudo: tlmgr: command not found
".tlmgr
if I give it the explicit path to that file/usr/local/texlive/.../tlmgr
(so I know the problem is not with permissions ontlmgr
).I investigated and found this answer to Command not found when using sudo.
It seems when I installed TeX Live 2020, I've added the texlive directory to the path for my user but not the superuser. To test this, run:
to see your path, and then
to see the path of the superuser. For me, the superuser path is missing the texlive directory, which is why I can run
tlmgr
but notsudo tlmgr
.Options:
You can ask sudo to run giving the full path to tlmgr (find this using
locate tlmgr
if you don't know where it is).You can ask sudo to run with your path instead of the superuser path by running
sudo -E env "PATH=$PATH" tlmgr
.You can edit the superuser path, if you are confident you know what you are doing, using
visudo
.I had the same problem. If tlmgr was installed successfully, try the following command to find your tlmgr path:
Then you can substitute tlmgr with the absolute path in your terminal command like the following:
I have the same problem with Ubuntu 18.04 MATE and TeXLive 2020. Formerly, I got over this issue by modifying the permission of the TEXDIR folder (e.g., /usr/local/texlive/2020). But this is not so elegant. I suppose there is better way to solve this issue.