1

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.

3

3 Answers 3

2

I am also having this problem. Specifically:

  • I can run tlmgr.
  • sudo cannot run tlmgr, giving "sudo: tlmgr: command not found".
  • sudo can run tlmgr if I give it the explicit path to that file /usr/local/texlive/.../tlmgr (so I know the problem is not with permissions on tlmgr).

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:

env | grep ^PATH

to see your path, and then

sudo env | grep ^PATH

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 not sudo tlmgr.

Options:

  1. 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).

  2. You can ask sudo to run with your path instead of the superuser path by running sudo -E env "PATH=$PATH" tlmgr.

  3. You can edit the superuser path, if you are confident you know what you are doing, using visudo.

2

I had the same problem. If tlmgr was installed successfully, try the following command to find your tlmgr path:

which tlmgr

Then you can substitute tlmgr with the absolute path in your terminal command like the following:

sudo /usr/local/texlive/2021/bin/x86_64-linux/tlmgr update --all
0

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.

1
  • Use comments to ask for more information or suggest improvements. Apr 23, 2020 at 14:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.